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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 | 95 |
96 FilePath resources_pack_path; | 96 FilePath resources_pack_path; |
97 PathService::Get(chrome::FILE_RESOURCES_PACK, &resources_pack_path); | 97 PathService::Get(chrome::FILE_RESOURCES_PACK, &resources_pack_path); |
98 ResourceBundle::AddDataPackToSharedInstance(resources_pack_path); | 98 ResourceBundle::AddDataPackToSharedInstance(resources_pack_path); |
99 } | 99 } |
100 | 100 |
101 // Now load the nib (from the right bundle). | 101 // Now load the nib (from the right bundle). |
102 scoped_nsobject<NSNib> | 102 scoped_nsobject<NSNib> |
103 nib([[NSNib alloc] initWithNibNamed:@"MainMenu" | 103 nib([[NSNib alloc] initWithNibNamed:@"MainMenu" |
104 bundle:mac_util::MainAppBundle()]); | 104 bundle:mac_util::MainAppBundle()]); |
| 105 // TODO(viettrungluu): crbug.com/20504 - This currently leaks, so if you |
| 106 // change this, you'll probably need to change the Valgrind suppression. |
105 [nib instantiateNibWithOwner:NSApp topLevelObjects:nil]; | 107 [nib instantiateNibWithOwner:NSApp topLevelObjects:nil]; |
106 // Make sure the app controller has been created. | 108 // Make sure the app controller has been created. |
107 DCHECK([NSApp delegate]); | 109 DCHECK([NSApp delegate]); |
108 | 110 |
109 // This is a no-op if the KeystoneRegistration framework is not present. | 111 // This is a no-op if the KeystoneRegistration framework is not present. |
110 // The framework is only distributed with branded Google Chrome builds. | 112 // The framework is only distributed with branded Google Chrome builds. |
111 [[KeystoneGlue defaultKeystoneGlue] registerWithKeystone]; | 113 [[KeystoneGlue defaultKeystoneGlue] registerWithKeystone]; |
112 | 114 |
113 // Prevent Cocoa from turning command-line arguments into | 115 // Prevent Cocoa from turning command-line arguments into |
114 // |-application:openFiles:|, since we already handle them directly. | 116 // |-application:openFiles:|, since we already handle them directly. |
115 [[NSUserDefaults standardUserDefaults] | 117 [[NSUserDefaults standardUserDefaults] |
116 setObject:@"NO" forKey:@"NSTreatUnknownArgumentsAsOpen"]; | 118 setObject:@"NO" forKey:@"NSTreatUnknownArgumentsAsOpen"]; |
117 } | 119 } |
118 }; | 120 }; |
119 | 121 |
120 // static | 122 // static |
121 BrowserMainParts* BrowserMainParts::CreateBrowserMainParts( | 123 BrowserMainParts* BrowserMainParts::CreateBrowserMainParts( |
122 const MainFunctionParams& parameters) { | 124 const MainFunctionParams& parameters) { |
123 return new BrowserMainPartsMac(parameters); | 125 return new BrowserMainPartsMac(parameters); |
124 } | 126 } |
OLD | NEW |