Chromium Code Reviews| Index: chrome/browser/shell_integration_win.cc |
| diff --git a/chrome/browser/shell_integration_win.cc b/chrome/browser/shell_integration_win.cc |
| index 869b5b51311f5ff8019a259bc8d3301c07c44629..ec66f50f851c10f254eed765cb607e01e812c65f 100644 |
| --- a/chrome/browser/shell_integration_win.cc |
| +++ b/chrome/browser/shell_integration_win.cc |
| @@ -389,8 +389,15 @@ void MigrateChromiumShortcutsCallback() { |
| } // namespace |
| -bool ShellIntegration::CanSetAsDefaultBrowser() { |
| - return BrowserDistribution::GetDistribution()->CanSetAsDefault(); |
| +ShellIntegration::DefaultSettingsChangePermission |
| + ShellIntegration::CanSetAsDefaultBrowser() { |
| + if (!BrowserDistribution::GetDistribution()->CanSetAsDefault()) |
| + return CHANGE_DEFAULT_NOT_ALLOWED; |
| + |
| + if (base::win::GetVersion() >= base::win::VERSION_WIN8) |
| + return CHANGE_DEFAULT_INTERACTIVE; |
| + else |
| + return CHANGE_DEFAULT_UNATTENDED; |
| } |
| bool ShellIntegration::SetAsDefaultBrowser() { |
| @@ -435,6 +442,24 @@ bool ShellIntegration::SetAsDefaultProtocolClient(const std::string& protocol) { |
| return true; |
| } |
| +bool ShellIntegration::StartSetAsDefaultBrowserInteractive() { |
| + FilePath chrome_exe; |
|
grt (UTC plus 2)
2012/05/28 20:47:02
should this enforce that it's being called on a pa
motek.
2012/05/31 21:59:04
I believed this has the same requirements as SetAs
|
| + if (!PathService::Get(base::FILE_EXE, &chrome_exe)) { |
| + NOTREACHED() << "Error getting app exe path"; |
| + return false; |
| + } |
| + |
| + BrowserDistribution* dist = BrowserDistribution::GetDistribution(); |
| + if (!ShellUtil::ShowMakeChromeDefaultSystemUI(dist, ShellUtil::CURRENT_USER, |
| + chrome_exe.value(), true)) { |
| + LOG(ERROR) << "Failed to launch the set-default-browser Windows UI."; |
| + return false; |
| + } |
| + |
| + VLOG(1) << "Set-as-default Windows UI triggered."; |
| + return true; |
| +} |
| + |
| ShellIntegration::DefaultWebClientState ShellIntegration::IsDefaultBrowser() { |
| // When we check for default browser we don't necessarily want to count file |
| // type handlers and icons as having changed the default browser status, |