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

Side by Side Diff: chrome/browser/chrome_browser_main_mac.mm

Issue 21150006: Introduce --cancel-first-run and reduce the strength of --no-first-run. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Replace hardcoded --no-first-run in scripts Created 7 years, 4 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 | Annotate | Revision Log
OLDNEW
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
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 (!parsed_command_line().HasSwitch(switches::kCancelFirstRun) &&
grt (UTC plus 2) 2013/07/30 02:48:16 how about abstracting the tests for flags away int
gab 2013/07/30 14:10:17 Done.
244 !parsed_command_line().HasSwitch(switches::kSkipFirstRun)) {
244 if (MaybeInstallFromDiskImage()) { 245 if (MaybeInstallFromDiskImage()) {
245 // The application was installed and the installed copy has been 246 // The application was installed and the installed copy has been
246 // launched. This process is now obsolete. Exit. 247 // launched. This process is now obsolete. Exit.
247 exit(0); 248 exit(0);
248 } 249 }
249 } 250 }
250 251
251 // Now load the nib (from the right bundle). 252 // Now load the nib (from the right bundle).
252 base::scoped_nsobject<NSNib> nib( 253 base::scoped_nsobject<NSNib> nib(
253 [[NSNib alloc] initWithNibNamed:@"MainMenu" 254 [[NSNib alloc] initWithNibNamed:@"MainMenu"
(...skipping 13 matching lines...) Expand all
267 void ChromeBrowserMainPartsMac::PostProfileInit() { 268 void ChromeBrowserMainPartsMac::PostProfileInit() {
268 ChromeBrowserMainPartsPosix::PostProfileInit(); 269 ChromeBrowserMainPartsPosix::PostProfileInit();
269 g_browser_process->metrics_service()->RecordBreakpadRegistration( 270 g_browser_process->metrics_service()->RecordBreakpadRegistration(
270 IsCrashReporterEnabled()); 271 IsCrashReporterEnabled());
271 } 272 }
272 273
273 void ChromeBrowserMainPartsMac::DidEndMainMessageLoop() { 274 void ChromeBrowserMainPartsMac::DidEndMainMessageLoop() {
274 AppController* appController = [NSApp delegate]; 275 AppController* appController = [NSApp delegate];
275 [appController didEndMainMessageLoop]; 276 [appController didEndMainMessageLoop];
276 } 277 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/login/login_browsertest.cc » ('j') | chrome/browser/first_run/first_run.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698