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

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

Issue 25531002: Move language detection to a component (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Run translate unittests on iOS Created 7 years, 2 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
« no previous file with comments | « chrome/browser/translate/translate_manager.cc ('k') | chrome/browser/translate/translate_script.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/translate/translate_prefs.cc
diff --git a/chrome/browser/translate/translate_prefs.cc b/chrome/browser/translate/translate_prefs.cc
index 794f74ffb891fa41dd4e0b927150bbad0fd3a1c8..db906a052eb6616f8a6653a3c56646a5e6fcd985 100644
--- a/chrome/browser/translate/translate_prefs.cc
+++ b/chrome/browser/translate/translate_prefs.cc
@@ -15,7 +15,7 @@
#include "chrome/browser/translate/translate_accept_languages.h"
#include "chrome/browser/translate/translate_manager.h"
#include "chrome/common/pref_names.h"
-#include "chrome/common/translate/translate_util.h"
+#include "components/translate/common/translate_util.h"
#include "components/user_prefs/pref_registry_syncable.h"
const char TranslatePrefs::kPrefTranslateLanguageBlacklist[] =
@@ -63,7 +63,7 @@ std::string ConvertLangCodeForTranslation(const std::string &lang) {
if (main_part == "zh")
return lang;
- TranslateUtil::ToTranslateLanguageSynonym(&main_part);
+ translate::ToTranslateLanguageSynonym(&main_part);
return main_part;
}
@@ -116,7 +116,7 @@ void TranslatePrefs::BlockLanguage(
// Add the language to the language list at chrome://settings/languages.
std::string language = original_language;
- TranslateUtil::ToChromeLanguageSynonym(&language);
+ translate::ToChromeLanguageSynonym(&language);
std::vector<std::string> languages;
GetLanguageList(&languages);
@@ -421,7 +421,7 @@ void TranslatePrefs::MigrateUserPrefs(PrefService* user_prefs) {
blocked_languages.begin();
it != blocked_languages.end(); ++it) {
std::string lang = *it;
- TranslateUtil::ToChromeLanguageSynonym(&lang);
+ translate::ToChromeLanguageSynonym(&lang);
bool not_found =
std::find(accept_languages.begin(), accept_languages.end(), lang) ==
accept_languages.end();
« no previous file with comments | « chrome/browser/translate/translate_manager.cc ('k') | chrome/browser/translate/translate_script.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698