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 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
368 | 368 |
369 // Launch the first run dialog only for certain builds, and only if the user | 369 // Launch the first run dialog only for certain builds, and only if the user |
370 // has not already set preferences. | 370 // has not already set preferences. |
371 if (IsOrganicFirstRun() && !local_state_file_exists) { | 371 if (IsOrganicFirstRun() && !local_state_file_exists) { |
372 // The home page string may be set in the preferences, but the user should | 372 // The home page string may be set in the preferences, but the user should |
373 // initially use Chrome with the NTP as home page in organic builds. | 373 // initially use Chrome with the NTP as home page in organic builds. |
374 profile->GetPrefs()->SetBoolean(prefs::kHomePageIsNewTabPage, true); | 374 profile->GetPrefs()->SetBoolean(prefs::kHomePageIsNewTabPage, true); |
375 ShowFirstRunDialog(profile); | 375 ShowFirstRunDialog(profile); |
376 } | 376 } |
377 | 377 |
378 if (make_chrome_default) | 378 if (make_chrome_default && |
| 379 ShellIntegration::CanSetAsDefaultBrowser() == |
| 380 ShellIntegration::CHANGE_DEFAULT_UNATTENDED) { |
379 ShellIntegration::SetAsDefaultBrowser(); | 381 ShellIntegration::SetAsDefaultBrowser(); |
| 382 } |
380 | 383 |
381 // Display the first run bubble if there is a default search provider. | 384 // Display the first run bubble if there is a default search provider. |
382 TemplateURLService* template_url = | 385 TemplateURLService* template_url = |
383 TemplateURLServiceFactory::GetForProfile(profile); | 386 TemplateURLServiceFactory::GetForProfile(profile); |
384 if (template_url && template_url->GetDefaultSearchProvider()) | 387 if (template_url && template_url->GetDefaultSearchProvider()) |
385 FirstRunBubbleLauncher::ShowFirstRunBubbleSoon(); | 388 FirstRunBubbleLauncher::ShowFirstRunBubbleSoon(); |
386 SetShowWelcomePagePref(); | 389 SetShowWelcomePagePref(); |
387 SetPersonalDataManagerFirstRunPref(); | 390 SetPersonalDataManagerFirstRunPref(); |
388 } | 391 } |
389 #endif // !defined(USE_AURA) | 392 #endif // !defined(USE_AURA) |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
533 | 536 |
534 // Reset the preference and notifications to avoid showing the bubble again. | 537 // Reset the preference and notifications to avoid showing the bubble again. |
535 prefs->SetBoolean(prefs::kShouldShowFirstRunBubble, false); | 538 prefs->SetBoolean(prefs::kShouldShowFirstRunBubble, false); |
536 | 539 |
537 // Show the bubble now and destroy this bubble launcher. | 540 // Show the bubble now and destroy this bubble launcher. |
538 browser->ShowFirstRunBubble(); | 541 browser->ShowFirstRunBubble(); |
539 delete this; | 542 delete this; |
540 } | 543 } |
541 | 544 |
542 } // namespace first_run | 545 } // namespace first_run |
OLD | NEW |