Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(156)

Unified Diff: components/translate/core/browser/translate_manager.h

Issue 1185703007: Disable translate when there is no API key (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: don't disable translate when testing Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/translate/core/browser/translate_manager.h
diff --git a/components/translate/core/browser/translate_manager.h b/components/translate/core/browser/translate_manager.h
index 74abcca48d12944762a8170aa723d5d4182b7f82..e69957c810a26c52607cba345b852ad81b4ff589 100644
--- a/components/translate/core/browser/translate_manager.h
+++ b/components/translate/core/browser/translate_manager.h
@@ -99,6 +99,8 @@ class TranslateManager {
// Gets the LanguageState associated with the TranslateManager
LanguageState& GetLanguageState();
+ static void SetIgnoreMissingKeyForTesting(bool ignore);
hajimehoshi 2015/07/08 04:41:35 Add a comment
+
private:
// Sends a translation request to the TranslateDriver.
void DoTranslatePage(const std::string& translate_script,
@@ -125,6 +127,10 @@ class TranslateManager {
base::WeakPtrFactory<TranslateManager> weak_method_factory_;
+ // By default, don't offer to translate in builds lacking an API key. For
+ // testing, set to true to offer anyway.
+ static bool ignore_missing_key_for_testing_;
+
DISALLOW_COPY_AND_ASSIGN(TranslateManager);
};

Powered by Google App Engine
This is Rietveld 408576698