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

Side by Side 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: error 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/browser_main.h" 5 #include "chrome/browser/browser_main.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 1451 matching lines...) Expand 10 before | Expand all | Expand 10 after
1462 // anything since it comes from Cocoa. 1462 // anything since it comes from Cocoa.
1463 #if defined(OS_MACOSX) 1463 #if defined(OS_MACOSX)
1464 g_browser_process->SetApplicationLocale(l10n_util::GetLocaleOverride()); 1464 g_browser_process->SetApplicationLocale(l10n_util::GetLocaleOverride());
1465 #else 1465 #else
1466 const std::string locale = 1466 const std::string locale =
1467 local_state->GetString(prefs::kApplicationLocale); 1467 local_state->GetString(prefs::kApplicationLocale);
1468 // On a POSIX OS other than ChromeOS, the parameter that is passed to the 1468 // On a POSIX OS other than ChromeOS, the parameter that is passed to the
1469 // method InitSharedInstance is ignored. 1469 // method InitSharedInstance is ignored.
1470 const std::string loaded_locale = 1470 const std::string loaded_locale =
1471 ResourceBundle::InitSharedInstance(locale); 1471 ResourceBundle::InitSharedInstance(locale);
1472 if (loaded_locale.empty() &&
1473 !parsed_command_line.HasSwitch(switches::kNoErrorDialogs)) {
1474 // This error message is not localized because we failed to load the
1475 // localization data files.
1476 const char* message =
1477 "Unable to find locale data files. Please reinstall.";
1478 const char* title = "Missing File Error";
1479 ShowMissingLocaleMessageBox(message, title);
1480 return chrome::RESULT_CODE_MISSING_DATA;
1481 }
1472 CHECK(!loaded_locale.empty()) << "Locale could not be found for " << locale; 1482 CHECK(!loaded_locale.empty()) << "Locale could not be found for " << locale;
1473 g_browser_process->SetApplicationLocale(loaded_locale); 1483 g_browser_process->SetApplicationLocale(loaded_locale);
1474 1484
1475 FilePath resources_pack_path; 1485 FilePath resources_pack_path;
1476 PathService::Get(chrome::FILE_RESOURCES_PACK, &resources_pack_path); 1486 PathService::Get(chrome::FILE_RESOURCES_PACK, &resources_pack_path);
1477 ResourceBundle::AddDataPackToSharedInstance(resources_pack_path); 1487 ResourceBundle::AddDataPackToSharedInstance(resources_pack_path);
1478 #endif // defined(OS_MACOSX) 1488 #endif // defined(OS_MACOSX)
1479 } 1489 }
1480 1490
1481 #if defined(TOOLKIT_GTK) 1491 #if defined(TOOLKIT_GTK)
(...skipping 676 matching lines...) Expand 10 before | Expand all | Expand 10 after
2158 #if defined(OS_CHROMEOS) 2168 #if defined(OS_CHROMEOS)
2159 // To be precise, logout (browser shutdown) is not yet done, but the 2169 // To be precise, logout (browser shutdown) is not yet done, but the
2160 // remaining work is negligible, hence we say LogoutDone here. 2170 // remaining work is negligible, hence we say LogoutDone here.
2161 chromeos::BootTimesLoader::Get()->AddLogoutTimeMarker("LogoutDone", 2171 chromeos::BootTimesLoader::Get()->AddLogoutTimeMarker("LogoutDone",
2162 false); 2172 false);
2163 chromeos::BootTimesLoader::Get()->WriteLogoutTimes(); 2173 chromeos::BootTimesLoader::Get()->WriteLogoutTimes();
2164 #endif 2174 #endif
2165 TRACE_EVENT_END_ETW("BrowserMain", 0, 0); 2175 TRACE_EVENT_END_ETW("BrowserMain", 0, 0);
2166 return result_code; 2176 return result_code;
2167 } 2177 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698