summaryrefslogtreecommitdiffstats
path: root/chrome/browser/translate
diff options
context:
space:
mode:
authorhbono@chromium.org <hbono@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-16 02:38:51 +0000
committerhbono@chromium.org <hbono@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-16 02:38:51 +0000
commit4f67d17c879cc6fac85f5baeb82115e5a5ca169f (patch)
tree3205b017b12f171eeb6563cdec4539d7570b8bbf /chrome/browser/translate
parent14b95f1e35ee10b56b0ec6b88d2f563d5c14e99b (diff)
downloadchromium_src-4f67d17c879cc6fac85f5baeb82115e5a5ca169f.zip
chromium_src-4f67d17c879cc6fac85f5baeb82115e5a5ca169f.tar.gz
chromium_src-4f67d17c879cc6fac85f5baeb82115e5a5ca169f.tar.bz2
Revert 117824 - Convert use of int ms to TimeDelta in files owned by brettw.
This change broke Linux and Mac bots. I would recommend to ask committers to run your next change on trybots. (*1) http://chromegw.corp.google.com/i/chromium/builders/Mac/builds/10788/steps/compile/logs/stdio (*2) http://chromegw.corp.google.com/i/chromium/builders/Linux/builds/19313/steps/compile/logs/stdio (*3) http://chromegw.corp.google.com/i/chromium/builders/Linux%20x64/builds/21385/steps/compile/logs/stdio R=brettw@chromium.org BUG=108171 TEST= Review URL: http://codereview.chromium.org/9185026 TBR=tedvessenes@gmail.com Review URL: http://codereview.chromium.org/9215005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@117825 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/translate')
-rw-r--r--chrome/browser/translate/translate_manager.cc7
-rw-r--r--chrome/browser/translate/translate_manager.h9
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_;