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/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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 NOTIMPLEMENTED(); | 63 NOTIMPLEMENTED(); |
64 return true; | 64 return true; |
65 } | 65 } |
66 | 66 |
67 FirstRunController::FirstRunController() | 67 FirstRunController::FirstRunController() |
68 : importer_host_(new ExternalProcessImporterHost) { | 68 : importer_host_(new ExternalProcessImporterHost) { |
69 } | 69 } |
70 | 70 |
71 void FirstRunController::FirstRunDone() { | 71 void FirstRunController::FirstRunDone() { |
72 // Set preference to show first run bubble and welcome page. | 72 // Set preference to show first run bubble and welcome page. |
73 // TODO(jeremy): Implement | 73 FirstRun::SetShowFirstRunBubblePref(true); |
74 // FirstRun::SetShowFirstRunBubblePref(true); | 74 FirstRun::SetShowWelcomePagePref(); |
75 // FirstRun::SetShowWelcomePagePref(); | |
76 delete this; | |
77 } | 75 } |
78 | 76 |
79 bool FirstRunController::DoFirstRun(Profile* profile, | 77 bool FirstRunController::DoFirstRun(Profile* profile, |
80 ProcessSingleton* process_singleton) { | 78 ProcessSingleton* process_singleton) { |
81 // This object is responsible for deleting itself, make sure that happens. | 79 // This object is responsible for deleting itself, make sure that happens. |
82 scoped_ptr<FirstRunController> gc(this); | 80 scoped_ptr<FirstRunController> gc(this); |
83 | 81 |
84 // Breakpad should not be enabled on first run until the user has explicitly | 82 // Breakpad should not be enabled on first run until the user has explicitly |
85 // opted-into stats. | 83 // opted-into stats. |
86 // TODO: The behavior we probably want here is to enable Breakpad on first run | 84 // TODO: The behavior we probably want here is to enable Breakpad on first run |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 | 142 |
145 // Import bookmarks. | 143 // Import bookmarks. |
146 if (!browser_import_disabled && [dialog.get() importBookmarks]) { | 144 if (!browser_import_disabled && [dialog.get() importBookmarks]) { |
147 const importer::ProfileInfo& source_profile = importer_host_-> | 145 const importer::ProfileInfo& source_profile = importer_host_-> |
148 GetSourceProfileInfoAt([dialog.get() browserImportSelectedIndex]); | 146 GetSourceProfileInfoAt([dialog.get() browserImportSelectedIndex]); |
149 int16 items = source_profile.services_supported; | 147 int16 items = source_profile.services_supported; |
150 // TODO(port): Do the actual import in a new process like Windows. | 148 // TODO(port): Do the actual import in a new process like Windows. |
151 ignore_result(gc.release()); | 149 ignore_result(gc.release()); |
152 StartImportingWithUI(nil, items, importer_host_.get(), | 150 StartImportingWithUI(nil, items, importer_host_.get(), |
153 source_profile, profile, this, true); | 151 source_profile, profile, this, true); |
| 152 } else { |
| 153 // This is called by the importer if it runs. |
| 154 FirstRunDone(); |
154 } | 155 } |
155 | 156 |
156 return true; | 157 return true; |
157 } | 158 } |
OLD | NEW |