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 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 out_prefs->do_import_items |= importer::FAVORITES; | 228 out_prefs->do_import_items |= importer::FAVORITES; |
229 else | 229 else |
230 out_prefs->dont_import_items |= importer::FAVORITES; | 230 out_prefs->dont_import_items |= importer::FAVORITES; |
231 } | 231 } |
232 | 232 |
233 if (install_prefs->GetBool( | 233 if (install_prefs->GetBool( |
234 installer::master_preferences::kMakeChromeDefaultForUser, | 234 installer::master_preferences::kMakeChromeDefaultForUser, |
235 &value) && value) { | 235 &value) && value) { |
236 out_prefs->make_chrome_default = true; | 236 out_prefs->make_chrome_default = true; |
237 } | 237 } |
| 238 |
| 239 if (install_prefs->GetBool( |
| 240 installer::master_preferences::kSuppressFirstRunDefaultBrowserPrompt, |
| 241 &value) && value) { |
| 242 out_prefs->suppress_first_run_default_browser_prompt = true; |
| 243 } |
238 } | 244 } |
239 | 245 |
240 void SetDefaultBrowser(installer::MasterPreferences* install_prefs){ | 246 void SetDefaultBrowser(installer::MasterPreferences* install_prefs){ |
241 // Even on the first run we only allow for the user choice to take effect if | 247 // Even on the first run we only allow for the user choice to take effect if |
242 // no policy has been set by the admin. | 248 // no policy has been set by the admin. |
243 if (!g_browser_process->local_state()->IsManagedPreference( | 249 if (!g_browser_process->local_state()->IsManagedPreference( |
244 prefs::kDefaultBrowserSettingEnabled)) { | 250 prefs::kDefaultBrowserSettingEnabled)) { |
245 bool value = false; | 251 bool value = false; |
246 if (install_prefs->GetBool( | 252 if (install_prefs->GetBool( |
247 installer::master_preferences::kMakeChromeDefaultForUser, | 253 installer::master_preferences::kMakeChromeDefaultForUser, |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
402 } // namespace internal | 408 } // namespace internal |
403 } // namespace first_run | 409 } // namespace first_run |
404 | 410 |
405 namespace first_run { | 411 namespace first_run { |
406 | 412 |
407 MasterPrefs::MasterPrefs() | 413 MasterPrefs::MasterPrefs() |
408 : ping_delay(0), | 414 : ping_delay(0), |
409 homepage_defined(false), | 415 homepage_defined(false), |
410 do_import_items(0), | 416 do_import_items(0), |
411 dont_import_items(0), | 417 dont_import_items(0), |
412 make_chrome_default(false) { | 418 make_chrome_default(false), |
| 419 suppress_first_run_default_browser_prompt(false) { |
413 } | 420 } |
414 | 421 |
415 MasterPrefs::~MasterPrefs() {} | 422 MasterPrefs::~MasterPrefs() {} |
416 | 423 |
417 bool IsChromeFirstRun() { | 424 bool IsChromeFirstRun() { |
418 if (internal::first_run_ != internal::FIRST_RUN_UNKNOWN) | 425 if (internal::first_run_ != internal::FIRST_RUN_UNKNOWN) |
419 return internal::first_run_ == internal::FIRST_RUN_TRUE; | 426 return internal::first_run_ == internal::FIRST_RUN_TRUE; |
420 | 427 |
421 FilePath first_run_sentinel; | 428 FilePath first_run_sentinel; |
422 if (!internal::GetFirstRunSentinelFilePath(&first_run_sentinel) || | 429 if (!internal::GetFirstRunSentinelFilePath(&first_run_sentinel) || |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
537 | 544 |
538 // Reset the preference and notifications to avoid showing the bubble again. | 545 // Reset the preference and notifications to avoid showing the bubble again. |
539 prefs->SetBoolean(prefs::kShouldShowFirstRunBubble, false); | 546 prefs->SetBoolean(prefs::kShouldShowFirstRunBubble, false); |
540 | 547 |
541 // Show the bubble now and destroy this bubble launcher. | 548 // Show the bubble now and destroy this bubble launcher. |
542 browser->ShowFirstRunBubble(); | 549 browser->ShowFirstRunBubble(); |
543 delete this; | 550 delete this; |
544 } | 551 } |
545 | 552 |
546 } // namespace first_run | 553 } // namespace first_run |
OLD | NEW |