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

Unified Diff: chrome/browser/browser_main.cc

Issue 7610009: If no locale data files can be found, show a dialog and exit (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix win compile Created 9 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 | « chrome/browser/browser_main.h ('k') | chrome/browser/browser_main_gtk.cc » ('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 5da1a3141be05b343422e7cebbca45287b5e97b0..d47d3ca72f2b256281ee42a88a168c1f6cf2880f 100644
--- a/chrome/browser/browser_main.cc
+++ b/chrome/browser/browser_main.cc
@@ -831,6 +831,14 @@ bool IsCrashReportingEnabled(const PrefService* local_state) {
} // namespace
+namespace chrome_browser {
+// This error message is not localized because we failed to load the
+// localization data files.
+const char kMissingLocaleDataTitle[] = "Missing File Error";
+const char kMissingLocaleDataMessage[] =
+ "Unable to find locale data files. Please reinstall.";
+} // namespace chrome_browser
+
// BrowserMainParts ------------------------------------------------------------
BrowserMainParts::BrowserMainParts(const MainFunctionParams& parameters)
@@ -1440,6 +1448,11 @@ int BrowserMain(const MainFunctionParams& parameters) {
// method InitSharedInstance is ignored.
const std::string loaded_locale =
ResourceBundle::InitSharedInstance(locale);
+ if (loaded_locale.empty() &&
+ !parsed_command_line.HasSwitch(switches::kNoErrorDialogs)) {
+ ShowMissingLocaleMessageBox();
+ return chrome::RESULT_CODE_MISSING_DATA;
+ }
CHECK(!loaded_locale.empty()) << "Locale could not be found for " << locale;
g_browser_process->SetApplicationLocale(loaded_locale);
« no previous file with comments | « chrome/browser/browser_main.h ('k') | chrome/browser/browser_main_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698