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. |