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 "base/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" |
8 #include "base/win/windows_version.h" | |
8 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
9 #include "chrome/browser/shell_integration.h" | 10 #include "chrome/browser/shell_integration.h" |
10 #include "chrome/browser/ui/browser.h" | 11 #include "chrome/browser/ui/browser.h" |
11 #include "chrome/browser/ui/browser_finder.h" | 12 #include "chrome/browser/ui/browser_finder.h" |
12 #include "chrome/browser/ui/webui/set_as_default_browser_ui.h" | 13 #include "chrome/browser/ui/webui/set_as_default_browser_ui.h" |
13 #include "components/startup_metric_utils/startup_metric_utils.h" | 14 #include "components/startup_metric_utils/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 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
63 registrar_.RemoveAll(); | 64 registrar_.RemoveAll(); |
64 SetAsDefaultBrowserUI::Show(profile_, browser); | 65 SetAsDefaultBrowserUI::Show(profile_, browser); |
65 delete this; | 66 delete this; |
66 } | 67 } |
67 | 68 |
68 } // namespace | 69 } // namespace |
69 | 70 |
70 namespace chrome { | 71 namespace chrome { |
71 | 72 |
72 bool ShowFirstRunDefaultBrowserPrompt(Profile* profile) { | 73 bool ShowFirstRunDefaultBrowserPrompt(Profile* profile) { |
74 // The behavior on Windows 10 is no good at the moment, so do not show the | |
msw
2015/07/10 19:54:03
nit: This comment doesn't really add value, maybe
| |
75 // prompt. | |
76 if (base::win::GetVersion() >= base::win::VERSION_WIN10) | |
77 return false; | |
78 | |
73 // If the only available mode of setting the default browser requires | 79 // If the only available mode of setting the default browser requires |
74 // user interaction, it means this couldn't have been done yet. Therefore, | 80 // user interaction, it means this couldn't have been done yet. Therefore, |
75 // we launch the dialog and inform the caller of it. | 81 // we launch the dialog and inform the caller of it. |
76 bool show_status = | 82 bool show_status = |
77 (ShellIntegration::CanSetAsDefaultBrowser() == | 83 (ShellIntegration::CanSetAsDefaultBrowser() == |
78 ShellIntegration::SET_DEFAULT_INTERACTIVE) && | 84 ShellIntegration::SET_DEFAULT_INTERACTIVE) && |
79 (ShellIntegration::GetDefaultBrowser() == ShellIntegration::NOT_DEFAULT); | 85 (ShellIntegration::GetDefaultBrowser() == ShellIntegration::NOT_DEFAULT); |
80 | 86 |
81 if (show_status) { | 87 if (show_status) { |
82 startup_metric_utils::SetNonBrowserUIDisplayed(); | 88 startup_metric_utils::SetNonBrowserUIDisplayed(); |
83 SetMetroBrowserFlowLauncher::LaunchSoon(profile); | 89 SetMetroBrowserFlowLauncher::LaunchSoon(profile); |
84 } | 90 } |
85 | 91 |
86 return show_status; | 92 return show_status; |
87 } | 93 } |
88 | 94 |
89 } // namespace chrome | 95 } // namespace chrome |
OLD | NEW |