summaryrefslogtreecommitdiffstats
path: root/chrome/browser/translate/translate_manager.h
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/translate/translate_manager.h')
-rw-r--r--chrome/browser/translate/translate_manager.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/chrome/browser/translate/translate_manager.h b/chrome/browser/translate/translate_manager.h
index 260f345..54debf4 100644
--- a/chrome/browser/translate/translate_manager.h
+++ b/chrome/browser/translate/translate_manager.h
@@ -51,7 +51,6 @@ class TranslateManager : public NotificationObserver,
void ReportLanguageDetectionError(TabContents* tab_contents);
// Clears the translate script, so it will be fetched next time we translate.
- // Currently used by unit-tests.
void ClearTranslateScript() { translate_script_.clear(); }
// NotificationObserver implementation:
@@ -67,6 +66,12 @@ class TranslateManager : public NotificationObserver,
const ResponseCookies& cookies,
const std::string& data);
+ // 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_ = delay_ms;
+ }
+
// Convenience method to know if a tab is showing a translate infobar.
static bool IsShowingTranslateInfobar(TabContents* tab);
@@ -158,6 +163,10 @@ class TranslateManager : public NotificationObserver,
// The JS injected in the page to do the translation.
std::string translate_script_;
+ // Delay in milli-seconds after which the translate script is fetched again
+ // from the translate server.
+ int translate_script_expiration_delay_;
+
// Whether the translate JS is currently being retrieved.
bool translate_script_request_pending_;