Index: chrome/browser/shell_integration_win.cc |
diff --git a/chrome/browser/shell_integration_win.cc b/chrome/browser/shell_integration_win.cc |
index f4c8609f43ec88bc8c84e97eb715f7ec009cafb8..6665e4dc083420dfdfc3c877b125a3010ad05f07 100644 |
--- a/chrome/browser/shell_integration_win.cc |
+++ b/chrome/browser/shell_integration_win.cc |
@@ -425,8 +425,15 @@ bool ActivateApplication(const string16& app_id) { |
} // 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() { |
@@ -471,6 +478,23 @@ bool ShellIntegration::SetAsDefaultProtocolClient(const std::string& protocol) { |
return true; |
} |
+bool ShellIntegration::SetAsDefaultBrowserInteractive() { |
+ FilePath chrome_exe; |
+ if (!PathService::Get(base::FILE_EXE, &chrome_exe)) { |
+ NOTREACHED() << "Error getting app exe path"; |
+ return false; |
+ } |
+ |
+ BrowserDistribution* dist = BrowserDistribution::GetDistribution(); |
+ if (!ShellUtil::ShowMakeChromeDefaultSystemUI(dist, chrome_exe.value())) { |
+ LOG(ERROR) << "Failed to launch the set-default-browser Windows UI."; |
gab
2012/06/06 22:47:21
LOG(DFATAL) is preferable here (as it will DCHECK
grt (UTC plus 2)
2012/06/07 02:50:36
I'm not so sure about this. Ideally, an integrati
motek.
2012/06/07 14:58:50
No code around here appears to do it in the same s
motek.
2012/06/07 14:58:50
Ack.
gab
2012/06/07 15:18:54
My thinking is that it's not 'FATAL' (and that's w
|
+ 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, |