OLD | NEW |
---|---|
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 1132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1143 g_browser_process->SetApplicationLocale("en-US"); | 1143 g_browser_process->SetApplicationLocale("en-US"); |
1144 } else { | 1144 } else { |
1145 // Mac starts it earlier in |PreMainMessageLoopStart()| (because it is | 1145 // Mac starts it earlier in |PreMainMessageLoopStart()| (because it is |
1146 // needed when loading the MainMenu.nib and the language doesn't depend on | 1146 // needed when loading the MainMenu.nib and the language doesn't depend on |
1147 // anything since it comes from Cocoa. | 1147 // anything since it comes from Cocoa. |
1148 #if defined(OS_MACOSX) | 1148 #if defined(OS_MACOSX) |
1149 g_browser_process->SetApplicationLocale(l10n_util::GetLocaleOverride()); | 1149 g_browser_process->SetApplicationLocale(l10n_util::GetLocaleOverride()); |
1150 #else | 1150 #else |
1151 // On a POSIX OS other than ChromeOS, the parameter that is passed to the | 1151 // On a POSIX OS other than ChromeOS, the parameter that is passed to the |
1152 // method InitSharedInstance is ignored. | 1152 // method InitSharedInstance is ignored. |
1153 std::string app_locale = ResourceBundle::InitSharedInstance( | 1153 std::string locale = local_state->GetString(prefs::kApplicationLocale); |
1154 local_state->GetString(prefs::kApplicationLocale)); | 1154 std::string app_locale = ResourceBundle::InitSharedInstance(locale); |
1155 CHECK(app_locale == locale) << "Locale could not be found for " << locale; | |
Peter Kasting
2010/12/20 17:18:48
Nit: CHECK_EQ
glotov
2010/12/21 13:19:08
Done.
| |
1155 g_browser_process->SetApplicationLocale(app_locale); | 1156 g_browser_process->SetApplicationLocale(app_locale); |
1156 | 1157 |
1157 FilePath resources_pack_path; | 1158 FilePath resources_pack_path; |
1158 PathService::Get(chrome::FILE_RESOURCES_PACK, &resources_pack_path); | 1159 PathService::Get(chrome::FILE_RESOURCES_PACK, &resources_pack_path); |
1159 ResourceBundle::AddDataPackToSharedInstance(resources_pack_path); | 1160 ResourceBundle::AddDataPackToSharedInstance(resources_pack_path); |
1160 #endif // !defined(OS_MACOSX) | 1161 #endif // !defined(OS_MACOSX) |
1161 } | 1162 } |
1162 | 1163 |
1163 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_CHROMEOS) | 1164 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_CHROMEOS) |
1164 // gdk_pixbuf_loader_write always fails on chromeos device. | 1165 // gdk_pixbuf_loader_write always fails on chromeos device. |
(...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1724 #if defined(OS_CHROMEOS) | 1725 #if defined(OS_CHROMEOS) |
1725 // To be precise, logout (browser shutdown) is not yet done, but the | 1726 // To be precise, logout (browser shutdown) is not yet done, but the |
1726 // remaining work is negligible, hence we say LogoutDone here. | 1727 // remaining work is negligible, hence we say LogoutDone here. |
1727 chromeos::BootTimesLoader::Get()->AddLogoutTimeMarker("LogoutDone", | 1728 chromeos::BootTimesLoader::Get()->AddLogoutTimeMarker("LogoutDone", |
1728 false); | 1729 false); |
1729 chromeos::BootTimesLoader::Get()->WriteLogoutTimes(); | 1730 chromeos::BootTimesLoader::Get()->WriteLogoutTimes(); |
1730 #endif | 1731 #endif |
1731 TRACE_EVENT_END("BrowserMain", 0, 0); | 1732 TRACE_EVENT_END("BrowserMain", 0, 0); |
1732 return result_code; | 1733 return result_code; |
1733 } | 1734 } |
OLD | NEW |