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

Unified Diff: chrome/browser/ui/webui/options2/browser_options_handler2.cc

Issue 10453041: Support for interactive set-chrome-as-default in Windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: A style fix Created 8 years, 7 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
Index: chrome/browser/ui/webui/options2/browser_options_handler2.cc
diff --git a/chrome/browser/ui/webui/options2/browser_options_handler2.cc b/chrome/browser/ui/webui/options2/browser_options_handler2.cc
index 081078bc77ddf6bcd1889603219d5dc9e3dfcb16..2989075a18d00263faf9dce7270eb776ed7e179b 100644
--- a/chrome/browser/ui/webui/options2/browser_options_handler2.cc
+++ b/chrome/browser/ui/webui/options2/browser_options_handler2.cc
@@ -679,7 +679,8 @@ void BrowserOptionsHandler::CheckAutoLaunchCallback(
void BrowserOptionsHandler::UpdateDefaultBrowserState() {
// Check for side-by-side first.
- if (!ShellIntegration::CanSetAsDefaultBrowser()) {
+ if (ShellIntegration::CanSetAsDefaultBrowser() ==
+ ShellIntegration::CHANGE_DEFAULT_NOT_ALLOWED) {
SetDefaultBrowserUIString(IDS_OPTIONS_DEFAULTBROWSER_SXS);
return;
}
@@ -707,14 +708,27 @@ void BrowserOptionsHandler::BecomeDefaultBrowser(const ListValue* args) {
if (default_browser_policy_.IsManaged())
return;
- content::RecordAction(UserMetricsAction("Options_SetAsDefaultBrowser"));
-#if defined(OS_MACOSX)
- if (ShellIntegration::SetAsDefaultBrowser())
+ if (ShellIntegration::CanSetAsDefaultBrowser() ==
+ ShellIntegration::CHANGE_DEFAULT_INTERACTIVE) {
+ // Interactive operation (a dialog has to be shown).
+ content::RecordAction(
+ UserMetricsAction("Options_ShowSetAsDefaultBrowser"));
grt (UTC plus 2) 2012/05/28 20:47:02 i don't know how these UserMetrics stuff work. do
motek. 2012/05/31 21:59:04 Ack. This is gone. Do you think I should somehow s
+ if (!ShellIntegration::StartSetAsDefaultBrowserInteractive()) {
+ content::RecordAction(
+ UserMetricsAction("Options_SetAsDefaultBrowserCancelled"));
grt (UTC plus 2) 2012/05/28 20:47:02 the comment for StartSetAsDefaultBrowserInteractiv
motek. 2012/05/31 21:59:04 The comment in the other place was indeed incorrec
+ return; // No updates needed.
+ }
UpdateDefaultBrowserState();
grt (UTC plus 2) 2012/05/28 20:47:02 hmm, this makes me think that StartSetAsDefaultBro
motek. 2012/05/31 21:59:04 You are correct. But there was another problem her
+ } else {
+ content::RecordAction(UserMetricsAction("Options_SetAsDefaultBrowser"));
+#if defined(OS_MACOSX)
+ if (ShellIntegration::SetAsDefaultBrowser())
+ UpdateDefaultBrowserState();
#else
- default_browser_worker_->StartSetAsDefault();
- // Callback takes care of updating UI.
+ default_browser_worker_->StartSetAsDefault();
+ // Callback takes care of updating UI.
#endif
+ }
// If the user attempted to make Chrome the default browser, then he/she
// arguably wants to be notified when that changes.

Powered by Google App Engine
This is Rietveld 408576698