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 #import <Cocoa/Cocoa.h> | 7 #import <Cocoa/Cocoa.h> |
8 | 8 |
9 #include "app/app_switches.h" | 9 #include "app/app_switches.h" |
10 #include "app/l10n_util_mac.h" | 10 #include "app/l10n_util_mac.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 | 39 |
40 // If ui_task is not NULL, the app is actually a browser_test, so startup is | 40 // If ui_task is not NULL, the app is actually a browser_test, so startup is |
41 // handled outside of BrowserMain (which is what called this). | 41 // handled outside of BrowserMain (which is what called this). |
42 if (!parameters.ui_task) { | 42 if (!parameters.ui_task) { |
43 // The browser process only wants to support the language Cocoa will use, so | 43 // The browser process only wants to support the language Cocoa will use, so |
44 // force the app locale to be overriden with that value. | 44 // force the app locale to be overriden with that value. |
45 l10n_util::OverrideLocaleWithCocoaLocale(); | 45 l10n_util::OverrideLocaleWithCocoaLocale(); |
46 | 46 |
47 // Before we load the nib, we need to start up the resource bundle so we | 47 // Before we load the nib, we need to start up the resource bundle so we |
48 // have the strings avaiable for localization. | 48 // have the strings avaiable for localization. |
49 ResourceBundle::InitSharedInstance(std::wstring()); | 49 std::wstring pref_locale; |
| 50 // TODO(markusheintz): Read preference pref::kApplicationLocale in order to |
| 51 // enforce the application locale. |
| 52 ResourceBundle::InitSharedInstance(pref_locale); |
50 | 53 |
51 FilePath resources_pack_path; | 54 FilePath resources_pack_path; |
52 PathService::Get(chrome::FILE_RESOURCES_PACK, &resources_pack_path); | 55 PathService::Get(chrome::FILE_RESOURCES_PACK, &resources_pack_path); |
53 ResourceBundle::AddDataPackToSharedInstance(resources_pack_path); | 56 ResourceBundle::AddDataPackToSharedInstance(resources_pack_path); |
54 } | 57 } |
55 | 58 |
56 // Now load the nib (from the right bundle). | 59 // Now load the nib (from the right bundle). |
57 scoped_nsobject<NSNib> | 60 scoped_nsobject<NSNib> |
58 nib([[NSNib alloc] initWithNibNamed:@"MainMenu" | 61 nib([[NSNib alloc] initWithNibNamed:@"MainMenu" |
59 bundle:mac_util::MainAppBundle()]); | 62 bundle:mac_util::MainAppBundle()]); |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 int HandleIconsCommands(const CommandLine& parsed_command_line) { | 100 int HandleIconsCommands(const CommandLine& parsed_command_line) { |
98 return 0; | 101 return 0; |
99 } | 102 } |
100 | 103 |
101 bool CheckMachineLevelInstall() { | 104 bool CheckMachineLevelInstall() { |
102 return false; | 105 return false; |
103 } | 106 } |
104 | 107 |
105 void PrepareRestartOnCrashEnviroment(const CommandLine& parsed_command_line) { | 108 void PrepareRestartOnCrashEnviroment(const CommandLine& parsed_command_line) { |
106 } | 109 } |
OLD | NEW |