| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/chrome_browser_main_mac.h" | 5 #include "chrome/browser/chrome_browser_main_mac.h" |
| 6 | 6 |
| 7 #import <Cocoa/Cocoa.h> | 7 #import <Cocoa/Cocoa.h> |
| 8 #include <sys/sysctl.h> | 8 #include <sys/sysctl.h> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 PathService::Get(chrome::FILE_RESOURCES_PACK, &resources_pack_path); | 222 PathService::Get(chrome::FILE_RESOURCES_PACK, &resources_pack_path); |
| 223 ResourceBundle::GetSharedInstance().AddDataPackFromPath( | 223 ResourceBundle::GetSharedInstance().AddDataPackFromPath( |
| 224 resources_pack_path, ui::SCALE_FACTOR_NONE); | 224 resources_pack_path, ui::SCALE_FACTOR_NONE); |
| 225 } | 225 } |
| 226 | 226 |
| 227 // This is a no-op if the KeystoneRegistration framework is not present. | 227 // This is a no-op if the KeystoneRegistration framework is not present. |
| 228 // The framework is only distributed with branded Google Chrome builds. | 228 // The framework is only distributed with branded Google Chrome builds. |
| 229 [[KeystoneGlue defaultKeystoneGlue] registerWithKeystone]; | 229 [[KeystoneGlue defaultKeystoneGlue] registerWithKeystone]; |
| 230 | 230 |
| 231 // Disk image installation is sort of a first-run task, so it shares the | 231 // Disk image installation is sort of a first-run task, so it shares the |
| 232 // kNoFirstRun switch. | 232 // no first run switches. |
| 233 // | 233 // |
| 234 // This needs to be done after the resource bundle is initialized (for | 234 // This needs to be done after the resource bundle is initialized (for |
| 235 // access to localizations in the UI) and after Keystone is initialized | 235 // access to localizations in the UI) and after Keystone is initialized |
| 236 // (because the installation may need to promote Keystone) but before the | 236 // (because the installation may need to promote Keystone) but before the |
| 237 // app controller is set up (and thus before MainMenu.nib is loaded, because | 237 // app controller is set up (and thus before MainMenu.nib is loaded, because |
| 238 // the app controller assumes that a browser has been set up and will crash | 238 // the app controller assumes that a browser has been set up and will crash |
| 239 // upon receipt of certain notifications if no browser exists), before | 239 // upon receipt of certain notifications if no browser exists), before |
| 240 // anyone tries doing anything silly like firing off an import job, and | 240 // anyone tries doing anything silly like firing off an import job, and |
| 241 // before anything creating preferences like Local State in order for the | 241 // before anything creating preferences like Local State in order for the |
| 242 // relaunched installed application to still consider itself as first-run. | 242 // relaunched installed application to still consider itself as first-run. |
| 243 if (!parsed_command_line().HasSwitch(switches::kNoFirstRun)) { | 243 if (!first_run::IsFirstRunSuppressed(parsed_command_line())) { |
| 244 if (MaybeInstallFromDiskImage()) { | 244 if (MaybeInstallFromDiskImage()) { |
| 245 // The application was installed and the installed copy has been | 245 // The application was installed and the installed copy has been |
| 246 // launched. This process is now obsolete. Exit. | 246 // launched. This process is now obsolete. Exit. |
| 247 exit(0); | 247 exit(0); |
| 248 } | 248 } |
| 249 } | 249 } |
| 250 | 250 |
| 251 // Now load the nib (from the right bundle). | 251 // Now load the nib (from the right bundle). |
| 252 base::scoped_nsobject<NSNib> nib( | 252 base::scoped_nsobject<NSNib> nib( |
| 253 [[NSNib alloc] initWithNibNamed:@"MainMenu" | 253 [[NSNib alloc] initWithNibNamed:@"MainMenu" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 267 void ChromeBrowserMainPartsMac::PostProfileInit() { | 267 void ChromeBrowserMainPartsMac::PostProfileInit() { |
| 268 ChromeBrowserMainPartsPosix::PostProfileInit(); | 268 ChromeBrowserMainPartsPosix::PostProfileInit(); |
| 269 g_browser_process->metrics_service()->RecordBreakpadRegistration( | 269 g_browser_process->metrics_service()->RecordBreakpadRegistration( |
| 270 IsCrashReporterEnabled()); | 270 IsCrashReporterEnabled()); |
| 271 } | 271 } |
| 272 | 272 |
| 273 void ChromeBrowserMainPartsMac::DidEndMainMessageLoop() { | 273 void ChromeBrowserMainPartsMac::DidEndMainMessageLoop() { |
| 274 AppController* appController = [NSApp delegate]; | 274 AppController* appController = [NSApp delegate]; |
| 275 [appController didEndMainMessageLoop]; | 275 [appController didEndMainMessageLoop]; |
| 276 } | 276 } |
| OLD | NEW |