diff options
Diffstat (limited to 'chrome/browser/translate')
-rw-r--r-- | chrome/browser/translate/translate_manager.cc | 7 | ||||
-rw-r--r-- | chrome/browser/translate/translate_manager.h | 9 |
2 files changed, 7 insertions, 9 deletions
diff --git a/chrome/browser/translate/translate_manager.cc b/chrome/browser/translate/translate_manager.cc index 94db9d2..8fd0c4f 100644 --- a/chrome/browser/translate/translate_manager.cc +++ b/chrome/browser/translate/translate_manager.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -138,7 +138,7 @@ const char* const kReportLanguageDetectionErrorURL = const char* const kLanguageListFetchURL = "http://translate.googleapis.com/translate_a/l?client=chrome&cb=sl"; const int kMaxRetryLanguageListFetch = 5; -const int kTranslateScriptExpirationDelayDays = 1; +const int kTranslateScriptExpirationDelayMS = 24 * 60 * 60 * 1000; // 1 day. } // namespace @@ -450,8 +450,7 @@ bool TranslateManager::IsShowingTranslateInfobar(WebContents* tab) { TranslateManager::TranslateManager() : ALLOW_THIS_IN_INITIALIZER_LIST(weak_method_factory_(this)), - translate_script_expiration_delay_( - base::TimeDelta::FromDays(kTranslateScriptExpirationDelayDays)) { + translate_script_expiration_delay_(kTranslateScriptExpirationDelayMS) { notification_registrar_.Add(this, content::NOTIFICATION_NAV_ENTRY_COMMITTED, content::NotificationService::AllSources()); notification_registrar_.Add(this, diff --git a/chrome/browser/translate/translate_manager.h b/chrome/browser/translate/translate_manager.h index 9409732..5e7f089 100644 --- a/chrome/browser/translate/translate_manager.h +++ b/chrome/browser/translate/translate_manager.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -83,8 +83,7 @@ class TranslateManager : public content::NotificationObserver, // Used by unit-tests to override the default delay after which the translate // script is fetched again from the translation server. void set_translate_script_expiration_delay(int delay_ms) { - translate_script_expiration_delay_ = - base::TimeDelta::FromMilliseconds(delay_ms); + translate_script_expiration_delay_ = delay_ms; } // Convenience method to know if a tab is showing a translate infobar. @@ -199,9 +198,9 @@ class TranslateManager : public content::NotificationObserver, // The JS injected in the page to do the translation. std::string translate_script_; - // Delay after which the translate script is fetched again + // Delay in milli-seconds after which the translate script is fetched again // from the translate server. - base::TimeDelta translate_script_expiration_delay_; + int translate_script_expiration_delay_; // Set when the translate JS is currently being retrieved. NULL otherwise. scoped_ptr<content::URLFetcher> translate_script_request_pending_; |