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/first_run/first_run.h" | 5 #include "chrome/browser/first_run/first_run.h" |
6 | 6 |
7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "chrome/browser/first_run/first_run_internal.h" | 9 #include "chrome/browser/first_run/first_run_internal.h" |
10 #include "chrome/browser/importer/importer_host.h" | 10 #include "chrome/browser/importer/importer_host.h" |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
140 out_prefs->new_tabs = install_prefs->GetFirstRunTabs(); | 140 out_prefs->new_tabs = install_prefs->GetFirstRunTabs(); |
141 | 141 |
142 internal::SetRLZPref(out_prefs, install_prefs.get()); | 142 internal::SetRLZPref(out_prefs, install_prefs.get()); |
143 | 143 |
144 if (!internal::CopyPrefFile(user_data_dir, master_prefs_path)) | 144 if (!internal::CopyPrefFile(user_data_dir, master_prefs_path)) |
145 return true; | 145 return true; |
146 | 146 |
147 internal::SetupMasterPrefsFromInstallPrefs(out_prefs, | 147 internal::SetupMasterPrefsFromInstallPrefs(out_prefs, |
148 install_prefs.get()); | 148 install_prefs.get()); |
149 | 149 |
150 // TODO(mirandac): Refactor skip-first-run-ui process into regular first run | |
151 // import process. http://crbug.com/49647 | |
152 // Note we are skipping all other master preferences if skip-first-run-ui | |
153 // is *not* specified. (That is, we continue only if skipping first run ui.) | |
150 if (!internal::SkipFirstRunUI(install_prefs.get())) | 154 if (!internal::SkipFirstRunUI(install_prefs.get())) |
msw
2012/07/10 17:31:46
We probably shouldn't ignore the rest of the maste
jennyz
2012/07/10 18:42:52
For the above change you proposed, I am a little c
msw
2012/07/10 19:33:19
Ah, I see what you mean. This code is horribly con
| |
151 return true; | 155 return true; |
152 | 156 |
153 // From here on we won't show first run so we need to do the work to show the | 157 // From here on we won't show first run so we need to do the work to show the |
154 // bubble anyway, unless it's already been explicitly suppressed. | 158 // bubble anyway, unless it's already been explicitly suppressed. |
155 SetShowFirstRunBubblePref(true); | 159 SetShowFirstRunBubblePref(true); |
156 | 160 |
157 // We need to be able to create the first run sentinel or else we cannot | 161 // We need to be able to create the first run sentinel or else we cannot |
158 // proceed because ImportSettings will launch the importer process which | 162 // proceed because ImportSettings will launch the importer process which |
159 // would end up here if the sentinel is not present. | 163 // would end up here if the sentinel is not present. |
160 if (!CreateSentinel()) | 164 if (!CreateSentinel()) |
161 return false; | 165 return false; |
162 | 166 |
163 internal::SetShowWelcomePagePrefIfNeeded(install_prefs.get()); | 167 internal::SetShowWelcomePagePrefIfNeeded(install_prefs.get()); |
164 internal::SetImportPreferencesAndLaunchImport(out_prefs, install_prefs.get()); | 168 internal::SetImportPreferencesAndLaunchImport(out_prefs, install_prefs.get()); |
165 internal::SetDefaultBrowser(install_prefs.get()); | 169 internal::SetDefaultBrowser(install_prefs.get()); |
166 | 170 |
167 return false; | 171 return false; |
168 } | 172 } |
169 | 173 |
170 | 174 |
171 } // namespace first_run | 175 } // namespace first_run |
OLD | NEW |