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

Unified Diff: chrome/browser/search/hotword_service.cc

Issue 496223002: Fall back to the application locale if a profile one doesn't exist on ChromeOS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Simplify. Created 6 years, 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/search/hotword_service.cc
diff --git a/chrome/browser/search/hotword_service.cc b/chrome/browser/search/hotword_service.cc
index 2f75b0394f5b73731f80cbde6ea0afd001deb541..8c63fc3632c83d34395bb3e842246064f3002f4c 100644
--- a/chrome/browser/search/hotword_service.cc
+++ b/chrome/browser/search/hotword_service.cc
@@ -142,14 +142,15 @@ ExtensionService* GetExtensionService(Profile* profile) {
}
std::string GetCurrentLocale(Profile* profile) {
- std::string locale =
#if defined(OS_CHROMEOS)
- // On ChromeOS locale is per-profile.
+ std::string profile_locale =
profile->GetPrefs()->GetString(prefs::kApplicationLocale);
-#else
- g_browser_process->GetApplicationLocale();
+ if (!profile_locale.empty()) {
+ // On ChromeOS locale is per-profile, but only if set.
+ return profile_locale;
+ }
#endif
- return locale;
+ return g_browser_process->GetApplicationLocale();
}
} // namespace
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698