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

Unified Diff: chrome/browser/translate/chrome_translate_client.cc

Issue 1903593002: Allows to manually change the stored permanent country in Variations from the translate-internals d… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: UI polishing Created 4 years, 8 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: chrome/browser/translate/chrome_translate_client.cc
diff --git a/chrome/browser/translate/chrome_translate_client.cc b/chrome/browser/translate/chrome_translate_client.cc
index d43dab077c940854043f1ba7144aa677a869a092..458464eb813fcd2e1c84be1461beb285f9a46125 100644
--- a/chrome/browser/translate/chrome_translate_client.cc
+++ b/chrome/browser/translate/chrome_translate_client.cc
@@ -169,6 +169,19 @@ void ChromeTranslateClient::GetTranslateLanguages(
translate::TranslateManager::GetTargetLanguage(translate_prefs.get());
}
+// static
+bool ChromeTranslateClient::OverrideStoredPermanentCountry(
+ const std::string& country) {
+ variations::VariationsService* variations_service =
+ g_browser_process->variations_service();
+ if (variations_service) {
+ return variations_service->ForceSetStoredPermanentCountry(country);
+ } else {
Alexei Svitkine (slow) 2016/04/20 20:30:23 No need for else if there's an early return.
hamelphi 2016/04/20 21:39:46 Removed changes from chrome_translate_client.
+ LOG(ERROR) << "Could not get variations service.";
Alexei Svitkine (slow) 2016/04/20 20:30:23 Nit: Make this a DLOG() so we don't bloat the prod
hamelphi 2016/04/20 21:39:46 Removed changes from chrome_translate_client.
+ }
+ return false;
+}
+
translate::TranslateManager* ChromeTranslateClient::GetTranslateManager() {
return translate_manager_.get();
}

Powered by Google App Engine
This is Rietveld 408576698