Bug 1250781 - Scroll "Default apps" into the default browser option. r=Gijs
authorMasatoshi Kimura <VYV03354@nifty.ne.jp>
Thu, 25 Feb 2016 07:10:35 +0900
changeset 285539 89a9d2c4edf4df6d2558b9ef1fc555ab69448163
parent 285538 bd7f29886069642dfde5049cc5b399b715fe24ca
child 285540 53b10ff5a66259400a440e03a135395a397f9962
push id72403
push usercbook@mozilla.com
push dateThu, 25 Feb 2016 10:59:17 +0000
treeherdermozilla-inbound@3b913f81cb98 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGijs
bugs1250781
milestone47.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1250781 - Scroll "Default apps" into the default browser option. r=Gijs
browser/components/shell/nsWindowsShellService.cpp
--- a/browser/components/shell/nsWindowsShellService.cpp
+++ b/browser/components/shell/nsWindowsShellService.cpp
@@ -653,16 +653,25 @@ nsWindowsShellService::LaunchModernSetti
                                 (void**)&pActivator);
 
   if (SUCCEEDED(hr)) {
     DWORD pid;
     hr = pActivator->ActivateApplication(
            L"windows.immersivecontrolpanel_cw5n1h2txyewy"
            L"!microsoft.windows.immersivecontrolpanel",
            L"page=SettingsPageAppsDefaults", AO_NONE, &pid);
+    if (SUCCEEDED(hr)) {
+      // Do not check error because we could at least open
+      // the "Default apps" setting.
+      pActivator->ActivateApplication(
+             L"windows.immersivecontrolpanel_cw5n1h2txyewy"
+             L"!microsoft.windows.immersivecontrolpanel",
+             L"page=SettingsPageAppsDefaults"
+             L"&target=SystemSettings_DefaultApps_Browser", AO_NONE, &pid);
+    }
     pActivator->Release();
     return SUCCEEDED(hr) ? NS_OK : NS_ERROR_FAILURE;
   }
   return NS_OK;
 }
 
 nsresult
 nsWindowsShellService::InvokeHTTPOpenAsVerb()