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 <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 724 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
735 ShellIntegration::CanSetAsDefaultBrowser() == | 735 ShellIntegration::CanSetAsDefaultBrowser() == |
736 ShellIntegration::SET_DEFAULT_UNATTENDED) { | 736 ShellIntegration::SET_DEFAULT_UNATTENDED) { |
737 ShellIntegration::SetAsDefaultBrowser(); | 737 ShellIntegration::SetAsDefaultBrowser(); |
738 } | 738 } |
739 | 739 |
740 base::FilePath local_state_path; | 740 base::FilePath local_state_path; |
741 PathService::Get(chrome::FILE_LOCAL_STATE, &local_state_path); | 741 PathService::Get(chrome::FILE_LOCAL_STATE, &local_state_path); |
742 bool local_state_file_exists = file_util::PathExists(local_state_path); | 742 bool local_state_file_exists = file_util::PathExists(local_state_path); |
743 | 743 |
744 // Launch the first run dialog only for certain builds, and only if the user | 744 // Launch the first run dialog only for certain builds, and only if the user |
745 // has not already set preferences. | 745 // has not already set preferences. If the dialog is shown, set state to avoid |
746 if (internal::IsOrganicFirstRun() && !local_state_file_exists) { | 746 // recording erroneous startup metrics. |
jeremy
2013/05/05 12:35:56
I don't think you need to update the comment - the
gab
2013/05/06 16:19:54
Done.
| |
747 if (internal::IsOrganicFirstRun() && !local_state_file_exists && | |
748 ShowFirstRunDialog(profile)) { | |
jeremy
2013/05/05 12:35:56
Please phrase as a nested if rather than compound
gab
2013/05/06 16:19:54
Done.
| |
747 startup_metric_utils::SetNonBrowserUIDisplayed(); | 749 startup_metric_utils::SetNonBrowserUIDisplayed(); |
748 ShowFirstRunDialog(profile); | |
749 } | 750 } |
750 // Display the first run bubble if there is a default search provider. | 751 // Display the first run bubble if there is a default search provider. |
751 TemplateURLService* template_url = | 752 TemplateURLService* template_url = |
752 TemplateURLServiceFactory::GetForProfile(profile); | 753 TemplateURLServiceFactory::GetForProfile(profile); |
753 if (template_url && template_url->GetDefaultSearchProvider()) | 754 if (template_url && template_url->GetDefaultSearchProvider()) |
754 FirstRunBubbleLauncher::ShowFirstRunBubbleSoon(); | 755 FirstRunBubbleLauncher::ShowFirstRunBubbleSoon(); |
755 SetShouldShowWelcomePage(); | 756 SetShouldShowWelcomePage(); |
756 SetShouldDoPersonalDataManagerFirstRun(); | 757 SetShouldDoPersonalDataManagerFirstRun(); |
757 | 758 |
758 internal::DoPostImportPlatformSpecificTasks(); | 759 internal::DoPostImportPlatformSpecificTasks(); |
759 } | 760 } |
760 | 761 |
761 bool DidPerformProfileImport(bool* exited_successfully) { | 762 bool DidPerformProfileImport(bool* exited_successfully) { |
762 if (exited_successfully) | 763 if (exited_successfully) |
763 *exited_successfully = profile_import_exited_successfully; | 764 *exited_successfully = profile_import_exited_successfully; |
764 return did_perform_profile_import; | 765 return did_perform_profile_import; |
765 } | 766 } |
766 | 767 |
767 } // namespace first_run | 768 } // namespace first_run |
OLD | NEW |