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_posix.h" | 5 #include "chrome/browser/browser_main_posix.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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
96 if (!parameters().ui_task) { | 96 if (!parameters().ui_task) { |
97 // The browser process only wants to support the language Cocoa will use, | 97 // The browser process only wants to support the language Cocoa will use, |
98 // so force the app locale to be overriden with that value. | 98 // so force the app locale to be overriden with that value. |
99 l10n_util::OverrideLocaleWithCocoaLocale(); | 99 l10n_util::OverrideLocaleWithCocoaLocale(); |
100 | 100 |
101 // Before we load the nib, we need to start up the resource bundle so we | 101 // Before we load the nib, we need to start up the resource bundle so we |
102 // have the strings avaiable for localization. | 102 // have the strings avaiable for localization. |
103 std::string pref_locale; | 103 std::string pref_locale; |
104 // TODO(markusheintz): Read preference pref::kApplicationLocale in order | 104 // TODO(markusheintz): Read preference pref::kApplicationLocale in order |
105 // to enforce the application locale. | 105 // to enforce the application locale. |
106 ResourceBundle::InitSharedInstance(pref_locale); | 106 std::string locale = ResourceBundle::InitSharedInstance(pref_locale); |
Peter Kasting
2010/12/21 18:35:58
Is this going to do the right thing? We've never
glotov
2010/12/21 20:33:34
Yes, looks confusing, I rewrote it.
As I mentioned
| |
107 CHECK(!locale.empty()) << "Locale could not be found for " << pref_locale; | |
Peter Kasting
2010/12/21 18:35:58
Nit: Same nit
glotov
2010/12/21 20:33:34
Done.
| |
107 | 108 |
108 FilePath resources_pack_path; | 109 FilePath resources_pack_path; |
109 PathService::Get(chrome::FILE_RESOURCES_PACK, &resources_pack_path); | 110 PathService::Get(chrome::FILE_RESOURCES_PACK, &resources_pack_path); |
110 ResourceBundle::AddDataPackToSharedInstance(resources_pack_path); | 111 ResourceBundle::AddDataPackToSharedInstance(resources_pack_path); |
111 } | 112 } |
112 | 113 |
113 // Now load the nib (from the right bundle). | 114 // Now load the nib (from the right bundle). |
114 scoped_nsobject<NSNib> | 115 scoped_nsobject<NSNib> |
115 nib([[NSNib alloc] initWithNibNamed:@"MainMenu" | 116 nib([[NSNib alloc] initWithNibNamed:@"MainMenu" |
116 bundle:mac_util::MainAppBundle()]); | 117 bundle:mac_util::MainAppBundle()]); |
(...skipping 25 matching lines...) Expand all Loading... | |
142 base::EnsureNSPRInit(); | 143 base::EnsureNSPRInit(); |
143 } | 144 } |
144 } | 145 } |
145 }; | 146 }; |
146 | 147 |
147 // static | 148 // static |
148 BrowserMainParts* BrowserMainParts::CreateBrowserMainParts( | 149 BrowserMainParts* BrowserMainParts::CreateBrowserMainParts( |
149 const MainFunctionParams& parameters) { | 150 const MainFunctionParams& parameters) { |
150 return new BrowserMainPartsMac(parameters); | 151 return new BrowserMainPartsMac(parameters); |
151 } | 152 } |
OLD | NEW |