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/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
259 void SetShowWelcomePagePrefIfNeeded( | 259 void SetShowWelcomePagePrefIfNeeded( |
260 installer::MasterPreferences* install_prefs) { | 260 installer::MasterPreferences* install_prefs) { |
261 bool value = false; | 261 bool value = false; |
262 if (install_prefs->GetBool( | 262 if (install_prefs->GetBool( |
263 installer::master_preferences::kDistroShowWelcomePage, &value) | 263 installer::master_preferences::kDistroShowWelcomePage, &value) |
264 && value) { | 264 && value) { |
265 SetShowWelcomePagePref(); | 265 SetShowWelcomePagePref(); |
266 } | 266 } |
267 } | 267 } |
268 | 268 |
269 bool SkipFirstRunUI(installer::MasterPreferences* install_prefs) { | 269 bool NotSkipFirstRunUI(installer::MasterPreferences* install_prefs) { |
msw
2012/07/10 01:51:21
I dislike this name, please leave it SkipFirstRunU
jennyz
2012/07/10 16:07:16
Done.
| |
270 // TODO(mirandac): Refactor skip-first-run-ui process into regular first run | 270 // TODO(mirandac): Refactor skip-first-run-ui process into regular first run |
271 // import process. http://crbug.com/49647 | 271 // import process. http://crbug.com/49647 |
272 // Note we are skipping all other master preferences if skip-first-run-ui | 272 // Note we are skipping all other master preferences if skip-first-run-ui |
msw
2012/07/10 01:51:21
This note/comment belong with the code that actual
jennyz
2012/07/10 16:07:16
Done.
| |
273 // is *not* specified. (That is, we continue only if skipping first run ui.) | 273 // is *not* specified. (That is, we continue only if skipping first run ui.) |
274 bool value = false; | 274 bool value = false; |
275 return (install_prefs->GetBool( | 275 return (!install_prefs->GetBool( |
msw
2012/07/10 01:51:21
In keeping the original name, this function can ju
jennyz
2012/07/10 16:07:16
Done.
| |
276 installer::master_preferences::kDistroSkipFirstRunPref, | 276 installer::master_preferences::kDistroSkipFirstRunPref, &value) |
277 &value) || !value); | 277 || !value); |
278 } | 278 } |
279 | 279 |
280 void SetRLZPref(first_run::MasterPrefs* out_prefs, | 280 void SetRLZPref(first_run::MasterPrefs* out_prefs, |
281 installer::MasterPreferences* install_prefs) { | 281 installer::MasterPreferences* install_prefs) { |
282 if (!install_prefs->GetInt(installer::master_preferences::kDistroPingDelay, | 282 if (!install_prefs->GetInt(installer::master_preferences::kDistroPingDelay, |
283 &out_prefs->ping_delay)) { | 283 &out_prefs->ping_delay)) { |
284 // Default value in case master preferences is missing or corrupt, | 284 // Default value in case master preferences is missing or corrupt, |
285 // or ping_delay is missing. | 285 // or ping_delay is missing. |
286 out_prefs->ping_delay = 90; | 286 out_prefs->ping_delay = 90; |
287 } | 287 } |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
541 | 541 |
542 // Reset the preference and notifications to avoid showing the bubble again. | 542 // Reset the preference and notifications to avoid showing the bubble again. |
543 prefs->SetBoolean(prefs::kShouldShowFirstRunBubble, false); | 543 prefs->SetBoolean(prefs::kShouldShowFirstRunBubble, false); |
544 | 544 |
545 // Show the bubble now and destroy this bubble launcher. | 545 // Show the bubble now and destroy this bubble launcher. |
546 browser->ShowFirstRunBubble(); | 546 browser->ShowFirstRunBubble(); |
547 delete this; | 547 delete this; |
548 } | 548 } |
549 | 549 |
550 } // namespace first_run | 550 } // namespace first_run |
OLD | NEW |