Chromium Code Reviews| 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..e5d0d5ddec5d3731e438bf946ac96857a6249c4f 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::CHANGE_DEFAULT_NOT_ALLOWED == |
|
grt (UTC plus 2)
2012/05/25 20:27:38
flip
motek.
2012/05/28 17:40:33
Done.
|
| + ShellIntegration::CanSetAsDefaultBrowser()) { |
|
grt (UTC plus 2)
2012/05/25 20:27:38
indent four more spaces
motek.
2012/05/28 17:40:33
Done.
|
| 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")); |
| + if (!ShellIntegration::StartSetAsDefaultBrowserInteractive()) { |
| + content::RecordAction( |
| + UserMetricsAction("Options_SetAsDefaultBrowserCancelled")); |
| + return; // No updates needed. |
| + } |
| UpdateDefaultBrowserState(); |
| + } 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. |