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" |
11 #include "chrome/browser/ui/browser_finder.h" | 11 #include "chrome/browser/ui/browser_finder.h" |
12 #include "chrome/browser/ui/webui/set_as_default_browser_ui.h" | 12 #include "chrome/browser/ui/webui/set_as_default_browser_ui.h" |
13 #include "chrome/common/pref_names.h" | 13 #include "chrome/common/pref_names.h" |
| 14 #include "chrome/common/startup_metric_utils.h" |
14 #include "content/public/browser/browser_thread.h" | 15 #include "content/public/browser/browser_thread.h" |
15 #include "content/public/browser/notification_service.h" | 16 #include "content/public/browser/notification_service.h" |
16 #include "content/public/browser/notification_types.h" | 17 #include "content/public/browser/notification_types.h" |
17 | 18 |
18 using content::BrowserThread; | 19 using content::BrowserThread; |
19 | 20 |
20 namespace { | 21 namespace { |
21 | 22 |
22 // Show the page prompting the user to make Chrome the default browser on | 23 // Show the page prompting the user to make Chrome the default browser on |
23 // Windows 8 (which means becoming "the browser" in Metro mode). The page | 24 // Windows 8 (which means becoming "the browser" in Metro mode). The page |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 bool ShowFirstRunDefaultBrowserPrompt(Profile* profile) { | 73 bool ShowFirstRunDefaultBrowserPrompt(Profile* profile) { |
73 // If the only available mode of setting the default browser requires | 74 // If the only available mode of setting the default browser requires |
74 // user interaction, it means this couldn't have been done yet. Therefore, | 75 // user interaction, it means this couldn't have been done yet. Therefore, |
75 // we launch the dialog and inform the caller of it. | 76 // we launch the dialog and inform the caller of it. |
76 bool show_status = | 77 bool show_status = |
77 (ShellIntegration::CanSetAsDefaultBrowser() == | 78 (ShellIntegration::CanSetAsDefaultBrowser() == |
78 ShellIntegration::SET_DEFAULT_INTERACTIVE) && | 79 ShellIntegration::SET_DEFAULT_INTERACTIVE) && |
79 (ShellIntegration::IsDefaultBrowser() == | 80 (ShellIntegration::IsDefaultBrowser() == |
80 ShellIntegration::NOT_DEFAULT_WEB_CLIENT); | 81 ShellIntegration::NOT_DEFAULT_WEB_CLIENT); |
81 | 82 |
82 if (show_status) | 83 if (show_status) { |
| 84 startup_metric_utils::SetNonBrowserUIDisplayed(); |
83 SetMetroBrowserFlowLauncher::LaunchSoon(profile); | 85 SetMetroBrowserFlowLauncher::LaunchSoon(profile); |
| 86 } |
84 | 87 |
85 return show_status; | 88 return show_status; |
86 } | 89 } |
87 | 90 |
88 } // namespace chrome | 91 } // namespace chrome |
OLD | NEW |