Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(529)

Unified Diff: chrome/browser/shell_integration_win.cc

Issue 10453041: Support for interactive set-chrome-as-default in Windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed the reviewer's remark. Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/shell_integration_mac.mm ('k') | chrome/browser/ui/cocoa/first_run_dialog.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..429649fcd8f7dbb7233c208cc0757b4d66c31713 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::DefaultWebClientSetPermission
+ ShellIntegration::CanSetAsDefaultBrowser() {
+ if (!BrowserDistribution::GetDistribution()->CanSetAsDefault())
+ return SET_DEFAULT_NOT_ALLOWED;
+
+ if (base::win::GetVersion() >= base::win::VERSION_WIN8)
+ return SET_DEFAULT_INTERACTIVE;
+ else
+ return SET_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.";
+ 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,
« no previous file with comments | « chrome/browser/shell_integration_mac.mm ('k') | chrome/browser/ui/cocoa/first_run_dialog.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698