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/ui/startup/default_browser_prompt.h" | 5 #include "chrome/browser/ui/startup/default_browser_prompt.h" |
6 | 6 |
7 #include "chrome/browser/prefs/pref_service.h" | 7 #include "chrome/browser/prefs/pref_service.h" |
8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
9 #include "chrome/browser/shell_integration.h" | 9 #include "chrome/browser/shell_integration.h" |
10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 // Unregister and delete. | 62 // Unregister and delete. |
63 registrar_.RemoveAll(); | 63 registrar_.RemoveAll(); |
64 SetAsDefaultBrowserUI::Show(profile_, browser); | 64 SetAsDefaultBrowserUI::Show(profile_, browser); |
65 delete this; | 65 delete this; |
66 } | 66 } |
67 | 67 |
68 } // namespace | 68 } // namespace |
69 | 69 |
70 namespace chrome { | 70 namespace chrome { |
71 | 71 |
72 void ShowFirstRunDefaultBrowserPrompt(Profile* profile) { | 72 bool ShowFirstRunDefaultBrowserPrompt(Profile* profile) { |
73 if ((ShellIntegration::IsDefaultBrowser() == | 73 // If the only available mode of setting the default browser requires |
74 ShellIntegration::NOT_DEFAULT_WEB_CLIENT) && | 74 // user interaction, it means this couldn't have been done yet. Therefore, |
| 75 // we launch the dialog and inform the caller of it. |
| 76 bool show_status = |
75 (ShellIntegration::CanSetAsDefaultBrowser() == | 77 (ShellIntegration::CanSetAsDefaultBrowser() == |
76 ShellIntegration::SET_DEFAULT_INTERACTIVE)) { | 78 ShellIntegration::SET_DEFAULT_INTERACTIVE) && |
77 // If the only available mode of setting the default browser requires | 79 (ShellIntegration::IsDefaultBrowser() == |
78 // user interaction, it means this couldn't have been done yet. | 80 ShellIntegration::NOT_DEFAULT_WEB_CLIENT); |
| 81 |
| 82 if (show_status) |
79 SetMetroBrowserFlowLauncher::LaunchSoon(profile); | 83 SetMetroBrowserFlowLauncher::LaunchSoon(profile); |
80 } | 84 |
| 85 return show_status; |
81 } | 86 } |
82 | 87 |
83 } // namespace chrome | 88 } // namespace chrome |
OLD | NEW |