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

Side by Side Diff: chrome/browser/browser_main.cc

Issue 2809058: Add application locale policy. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: " Created 10 years, 5 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
« no previous file with comments | « chrome/app/policy/windows/admx/en-US/chrome.adml ('k') | chrome/browser/browser_main_mac.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 794 matching lines...) Expand 10 before | Expand all | Expand 10 after
805 // has already been initialized. 805 // has already been initialized.
806 if (parameters.ui_task) { 806 if (parameters.ui_task) {
807 g_browser_process->SetApplicationLocale("en-US"); 807 g_browser_process->SetApplicationLocale("en-US");
808 } else { 808 } else {
809 // Mac starts it earlier in WillInitializeMainMessageLoop (because 809 // Mac starts it earlier in WillInitializeMainMessageLoop (because
810 // it is needed when loading the MainMenu.nib and the language doesn't 810 // it is needed when loading the MainMenu.nib and the language doesn't
811 // depend on anything since it comes from Cocoa. 811 // depend on anything since it comes from Cocoa.
812 #if defined(OS_MACOSX) 812 #if defined(OS_MACOSX)
813 g_browser_process->SetApplicationLocale(l10n_util::GetLocaleOverride()); 813 g_browser_process->SetApplicationLocale(l10n_util::GetLocaleOverride());
814 #else 814 #else
815 // On a POSIX OS other than ChromeOS, the parameter that is passed to the
816 // method InitSharedInstance is ignored.
815 std::string app_locale = ResourceBundle::InitSharedInstance( 817 std::string app_locale = ResourceBundle::InitSharedInstance(
816 ASCIIToWide(local_state->GetString(prefs::kApplicationLocale))); 818 ASCIIToWide(local_state->GetString(prefs::kApplicationLocale)));
817 g_browser_process->SetApplicationLocale(app_locale); 819 g_browser_process->SetApplicationLocale(app_locale);
818 820
819 FilePath resources_pack_path; 821 FilePath resources_pack_path;
820 PathService::Get(chrome::FILE_RESOURCES_PACK, &resources_pack_path); 822 PathService::Get(chrome::FILE_RESOURCES_PACK, &resources_pack_path);
821 ResourceBundle::AddDataPackToSharedInstance(resources_pack_path); 823 ResourceBundle::AddDataPackToSharedInstance(resources_pack_path);
822 #endif // !defined(OS_MACOSX) 824 #endif // !defined(OS_MACOSX)
823 } 825 }
824 826
(...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after
1298 1300
1299 metrics->Stop(); 1301 metrics->Stop();
1300 1302
1301 // browser_shutdown takes care of deleting browser_process, so we need to 1303 // browser_shutdown takes care of deleting browser_process, so we need to
1302 // release it. 1304 // release it.
1303 ignore_result(browser_process.release()); 1305 ignore_result(browser_process.release());
1304 browser_shutdown::Shutdown(); 1306 browser_shutdown::Shutdown();
1305 1307
1306 return result_code; 1308 return result_code;
1307 } 1309 }
OLDNEW
« no previous file with comments | « chrome/app/policy/windows/admx/en-US/chrome.adml ('k') | chrome/browser/browser_main_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698