diff options
author | jeremy@chromium.org <jeremy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-28 15:56:12 +0000 |
---|---|---|
committer | jeremy@chromium.org <jeremy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-28 15:56:12 +0000 |
commit | 8240e999612351e82d797a3274111241b5d99419 (patch) | |
tree | 1725c05ee8d9753f6536624bb20e372559bdf14f /chrome/browser/first_run_mac.mm | |
parent | 7bdc1bf06709860ce79f9c9fa21d0b382306b95c (diff) | |
download | chromium_src-8240e999612351e82d797a3274111241b5d99419.zip chromium_src-8240e999612351e82d797a3274111241b5d99419.tar.gz chromium_src-8240e999612351e82d797a3274111241b5d99419.tar.bz2 |
Nice looking First-Run dialogs.
* Switch NIB.
* Use NSWindowController.
* "Make default browser" button hooked up.
* Import bookmarks still not implemented.
Review URL: http://codereview.chromium.org/149512
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21844 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/first_run_mac.mm')
-rw-r--r-- | chrome/browser/first_run_mac.mm | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/chrome/browser/first_run_mac.mm b/chrome/browser/first_run_mac.mm index 7292e9d..2764a31 100644 --- a/chrome/browser/first_run_mac.mm +++ b/chrome/browser/first_run_mac.mm @@ -8,6 +8,8 @@ #include "base/sys_string_conversions.h" #import "chrome/app/breakpad_mac.h" #import "chrome/browser/cocoa/first_run_dialog.h" +#include "chrome/browser/metrics/user_metrics.h" +#include "chrome/browser/shell_integration.h" #include "chrome/installer/util/google_update_constants.h" #include "chrome/installer/util/google_update_settings.h" @@ -44,9 +46,15 @@ bool OpenFirstRunDialog(Profile* profile, ProcessSingleton* process_singleton) { scoped_nsobject<FirstRunDialogController> dialog( [[FirstRunDialogController alloc] init]); - bool stats_enabled = [dialog.get() Show]; + // FirstRunDialogController will call exit if "Cancel" is clicked. + [dialog.get() showWindow:nil]; - GoogleUpdateSettings::SetCollectStatsConsent(stats_enabled); + // If user clicked cancel, bail. + if ([dialog.get() userDidCancel]) { + return false; + } + + BOOL stats_enabled = [dialog.get() statsEnabled]; // Breakpad is normally enabled very early in the startup process, // however, on the first run it's off by default. If the user opts-in to @@ -55,6 +63,17 @@ bool OpenFirstRunDialog(Profile* profile, ProcessSingleton* process_singleton) { InitCrashReporter(); InitCrashProcessInfo(); } + + GoogleUpdateSettings::SetCollectStatsConsent(stats_enabled); + + BOOL make_default_browser = [dialog.get() makeDefaultBrowser]; + if (make_default_browser) { + bool success = ShellIntegration::SetAsDefaultBrowser(); + DCHECK(success); + } + + // TODO(jeremy): Import Bookmarks. + #endif // defined(GOOGLE_CHROME_BUILD) return true; } |