Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/first_run.h" | 5 #include "chrome/browser/first_run.h" |
| 6 | 6 |
| 7 #import "base/scoped_nsobject.h" | 7 #import "base/scoped_nsobject.h" |
| 8 #include "base/sys_string_conversions.h" | 8 #include "base/sys_string_conversions.h" |
| 9 #import "chrome/app/breakpad_mac.h" | 9 #import "chrome/app/breakpad_mac.h" |
| 10 #import "chrome/browser/cocoa/first_run_dialog.h" | 10 #import "chrome/browser/cocoa/first_run_dialog.h" |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 113 | 113 |
| 114 // FirstRunDialogController will call exit if "Cancel" is clicked. | 114 // FirstRunDialogController will call exit if "Cancel" is clicked. |
| 115 [dialog.get() showWindow:nil]; | 115 [dialog.get() showWindow:nil]; |
| 116 | 116 |
| 117 // If user clicked cancel, bail - browser_main will return if we haven't | 117 // If user clicked cancel, bail - browser_main will return if we haven't |
| 118 // turned off the first run flag when this function returns. | 118 // turned off the first run flag when this function returns. |
| 119 if ([dialog.get() userDidCancel]) { | 119 if ([dialog.get() userDidCancel]) { |
| 120 return false; | 120 return false; |
| 121 } | 121 } |
| 122 | 122 |
| 123 // Don't enable stats in Chromium. | |
| 124 #if defined(GOOGLE_CHROME_BUILD) | 123 #if defined(GOOGLE_CHROME_BUILD) |
| 125 BOOL stats_enabled = [dialog.get() statsEnabled]; | 124 BOOL stats_enabled = [dialog.get() statsEnabled]; |
| 126 | 125 |
| 127 // Breakpad is normally enabled very early in the startup process, | 126 // Breakpad is normally enabled very early in the startup process, |
| 128 // however, on the first run it's off by default. If the user opts-in to | 127 // however, on the first run it's off by default. If the user opts-in to |
| 129 // stats, enable breakpad. | 128 // stats, enable breakpad. |
| 130 if (stats_enabled) { | 129 if (stats_enabled) { |
| 131 InitCrashReporter(); | 130 InitCrashReporter(); |
| 132 InitCrashProcessInfo(); | 131 InitCrashProcessInfo(); |
| 133 } | 132 } |
| 134 | 133 |
| 134 | |
| 135 #else | |
|
stuartmorgan
2009/08/12 17:49:46
Seems like this would make more sense right after
| |
| 136 // Don't enable stats in Chromium. | |
| 137 BOOL stats_enabled = NO; | |
| 138 #endif // GOOGLE_CHROME_BUILD | |
| 139 | |
| 135 GoogleUpdateSettings::SetCollectStatsConsent(stats_enabled); | 140 GoogleUpdateSettings::SetCollectStatsConsent(stats_enabled); |
| 136 #endif // GOOGLE_CHROME_BUILD | |
| 137 | 141 |
| 138 // If selected set as default browser. | 142 // If selected set as default browser. |
| 139 BOOL make_default_browser = [dialog.get() makeDefaultBrowser]; | 143 BOOL make_default_browser = [dialog.get() makeDefaultBrowser]; |
| 140 if (make_default_browser) { | 144 if (make_default_browser) { |
| 141 bool success = ShellIntegration::SetAsDefaultBrowser(); | 145 bool success = ShellIntegration::SetAsDefaultBrowser(); |
| 142 DCHECK(success); | 146 DCHECK(success); |
| 143 } | 147 } |
| 144 | 148 |
| 145 // Import bookmarks. | 149 // Import bookmarks. |
| 146 if ([dialog.get() importBookmarks]) { | 150 if ([dialog.get() importBookmarks]) { |
| 147 const ProfileInfo& source_profile = importer_host_->GetSourceProfileInfoAt( | 151 const ProfileInfo& source_profile = importer_host_->GetSourceProfileInfoAt( |
| 148 [dialog.get() browserImportSelectedIndex]); | 152 [dialog.get() browserImportSelectedIndex]); |
| 149 int16 items = source_profile.services_supported; | 153 int16 items = source_profile.services_supported; |
| 150 // TODO(port): Do the actual import in a new process like Windows. | 154 // TODO(port): Do the actual import in a new process like Windows. |
| 151 gc.release(); | 155 gc.release(); |
| 152 StartImportingWithUI(nil, items, importer_host_.get(), | 156 StartImportingWithUI(nil, items, importer_host_.get(), |
| 153 source_profile, profile, this, true); | 157 source_profile, profile, this, true); |
| 154 } | 158 } |
| 155 | 159 |
| 156 return true; | 160 return true; |
| 157 } | 161 } |
| OLD | NEW |