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

Unified Diff: chrome/browser/browser_main.cc

Issue 5939002: Error handling added (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync up Created 10 years 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/app/chrome_main.cc ('k') | chrome/browser/browser_main_mac.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/browser_main.cc
diff --git a/chrome/browser/browser_main.cc b/chrome/browser/browser_main.cc
index 904c6e27e59e42854b0bc7a2e582aa8b6cb31ad8..7f535f6f29c1076bf3de79d014bbdf953953d983 100644
--- a/chrome/browser/browser_main.cc
+++ b/chrome/browser/browser_main.cc
@@ -615,7 +615,8 @@ PrefService* InitializeLocalState(const CommandLine& parsed_command_line,
// Initialize ResourceBundle which handles files loaded from external
// sources. This has to be done before uninstall code path and before prefs
// are registered.
- local_state->RegisterStringPref(prefs::kApplicationLocale, "");
+ local_state->RegisterStringPref(prefs::kApplicationLocale,
+ std::string());
#if !defined(OS_CHROMEOS)
local_state->RegisterBooleanPref(prefs::kMetricsReportingEnabled,
GoogleUpdateSettings::GetCollectStatsConsent());
@@ -1151,9 +1152,12 @@ int BrowserMain(const MainFunctionParams& parameters) {
#else
// On a POSIX OS other than ChromeOS, the parameter that is passed to the
// method InitSharedInstance is ignored.
- std::string app_locale = ResourceBundle::InitSharedInstance(
- local_state->GetString(prefs::kApplicationLocale));
- g_browser_process->SetApplicationLocale(app_locale);
+ const std::string locale =
+ local_state->GetString(prefs::kApplicationLocale);
+ const std::string loaded_locale =
+ ResourceBundle::InitSharedInstance(locale);
+ CHECK(!loaded_locale.empty()) << "Locale could not be found for " << locale;
+ g_browser_process->SetApplicationLocale(loaded_locale);
FilePath resources_pack_path;
PathService::Get(chrome::FILE_RESOURCES_PACK, &resources_pack_path);
« no previous file with comments | « chrome/app/chrome_main.cc ('k') | chrome/browser/browser_main_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698