summaryrefslogtreecommitdiff
path: root/toolkit/mozapps/update
diff options
context:
space:
mode:
Diffstat (limited to 'toolkit/mozapps/update')
-rw-r--r--toolkit/mozapps/update/common/updatehelper.cpp79
-rw-r--r--toolkit/mozapps/update/common/updatehelper.h5
-rw-r--r--toolkit/mozapps/update/nsIUpdateService.idl5
-rw-r--r--toolkit/mozapps/update/tests/chrome/utils.js13
-rw-r--r--toolkit/mozapps/update/tests/shared.js1
-rw-r--r--toolkit/mozapps/update/tests/unit_aus_update/head_update.js1
-rw-r--r--toolkit/mozapps/update/updater/updater.cpp27
7 files changed, 4 insertions, 127 deletions
diff --git a/toolkit/mozapps/update/common/updatehelper.cpp b/toolkit/mozapps/update/common/updatehelper.cpp
index f9e1989ef..ed582b61a 100644
--- a/toolkit/mozapps/update/common/updatehelper.cpp
+++ b/toolkit/mozapps/update/common/updatehelper.cpp
@@ -2,17 +2,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-#ifdef MOZ_METRO
-// Needed for COM calls to launch Metro applications
-#undef WINVER
-#undef _WIN32_WINNT
-#define WINVER 0x602
-#define _WIN32_WINNT 0x602
-#include <objbase.h>
-#include <shobjidl.h>
-#pragma comment(lib, "ole32.lib")
-#endif
-
#include <windows.h>
// Needed for CreateToolhelp32Snapshot
@@ -616,71 +605,3 @@ IsUnpromptedElevation(BOOL &isUnpromptedElevation)
RegCloseKey(baseKey);
return success;
}
-
-#ifdef MOZ_METRO
- /*
- * Retrieve the app model id of the firefox metro browser.
- *
- * @aPathBuffer Buffer to fill
- * @aCharLength Length of buffer to fill in characters
- */
- bool GetDefaultBrowserAppModelID(WCHAR* aIDBuffer, long aCharLength)
- {
- if (!aIDBuffer || aCharLength <= 0)
- return false;
-
- memset(aIDBuffer, 0, (sizeof(WCHAR)*aCharLength));
- static const WCHAR* kDefaultMetroBrowserIDPathKey = L"FirefoxURL";
-
- HKEY key;
- if (RegOpenKeyExW(HKEY_CLASSES_ROOT, kDefaultMetroBrowserIDPathKey,
- 0, KEY_READ, &key) != ERROR_SUCCESS) {
- return false;
- }
- DWORD len = aCharLength * sizeof(WCHAR);
- memset(aIDBuffer, 0, len);
- if (RegQueryValueExW(key, L"AppUserModelID", nullptr, nullptr,
- (LPBYTE)aIDBuffer, &len) != ERROR_SUCCESS || !len) {
- RegCloseKey(key);
- return false;
- }
- RegCloseKey(key);
- return true;
- }
-
- HRESULT
- LaunchDefaultMetroBrowser()
- {
- CoInitialize(nullptr);
- HRESULT hr = E_FAIL;
- // The interface that allows us to activate the browser
- IApplicationActivationManager *activateMgr;
- if (FAILED(hr = CoCreateInstance(CLSID_ApplicationActivationManager,
- nullptr, CLSCTX_LOCAL_SERVER,
- IID_IApplicationActivationManager,
- (void**)&activateMgr))) {
- CoUninitialize();
- return hr;
- }
-
- // Activation is based on the browser's registered app model id
- WCHAR appModelID[256];
- if (!GetDefaultBrowserAppModelID(appModelID, (sizeof(appModelID)/sizeof(WCHAR)))) {
- activateMgr->Release();
- CoUninitialize();
- return hr;
- }
-
- // Hand off focus rights to the out-of-process activation server. Without
- // this the metro interface won't launch.
- CoAllowSetForegroundWindow(activateMgr, nullptr);
-
- // Launch default browser in Metro
- DWORD processID;
- hr = activateMgr->ActivateApplication(appModelID, L"", AO_NOERRORUI,
- &processID);
- activateMgr->Release();
- CoUninitialize();
- return hr;
- }
-#endif
diff --git a/toolkit/mozapps/update/common/updatehelper.h b/toolkit/mozapps/update/common/updatehelper.h
index 8c87ee054..155ac8b0e 100644
--- a/toolkit/mozapps/update/common/updatehelper.h
+++ b/toolkit/mozapps/update/common/updatehelper.h
@@ -26,8 +26,3 @@ BOOL IsUnpromptedElevation(BOOL &isUnpromptedElevation);
#define TEST_ONLY_FALLBACK_KEY_PATH \
BASE_SERVICE_REG_KEY L"\\3932ecacee736d366d6436db0f55bce4"
-#ifdef MOZ_METRO
- bool GetDefaultBrowserAppModelID(WCHAR* aIDBuffer, long aCharLength);
- HRESULT LaunchDefaultMetroBrowser();
-#endif
-
diff --git a/toolkit/mozapps/update/nsIUpdateService.idl b/toolkit/mozapps/update/nsIUpdateService.idl
index 5e05dfd06..4e2e32cb3 100644
--- a/toolkit/mozapps/update/nsIUpdateService.idl
+++ b/toolkit/mozapps/update/nsIUpdateService.idl
@@ -443,9 +443,8 @@ interface nsIApplicationUpdateService : nsISupports
/**
* Whether or not a different instance is handling updates of this
* installation. This currently only ever returns true on Windows
- * when 2 instances of an application are open or when both the Metro
- * and Desktop browsers are open. Only one of the instances will actually
- * handle updates for the installation.
+ * when 2 instances of an application are open. Only one of the
+ * instances will actually handle updates for the installation.
*/
readonly attribute boolean isOtherInstanceHandlingUpdates;
diff --git a/toolkit/mozapps/update/tests/chrome/utils.js b/toolkit/mozapps/update/tests/chrome/utils.js
index 4c7c2699b..963a0c886 100644
--- a/toolkit/mozapps/update/tests/chrome/utils.js
+++ b/toolkit/mozapps/update/tests/chrome/utils.js
@@ -181,7 +181,6 @@ var gCloseWindowTimeoutCounter = 0;
// The following vars are for restoring previous preference values (if present)
// when the test finishes.
var gAppUpdateEnabled; // app.update.enabled
-var gAppUpdateMetroEnabled; // app.update.metro.enabled
var gAppUpdateServiceEnabled; // app.update.service.enabled
var gAppUpdateStagingEnabled; // app.update.staging.enabled
var gAppUpdateURLDefault; // app.update.url (default prefbranch)
@@ -898,11 +897,6 @@ function setupPrefs() {
}
Services.prefs.setBoolPref(PREF_APP_UPDATE_ENABLED, true);
- if (Services.prefs.prefHasUserValue(PREF_APP_UPDATE_METRO_ENABLED)) {
- gAppUpdateMetroEnabled = Services.prefs.getBoolPref(PREF_APP_UPDATE_METRO_ENABLED);
- }
- Services.prefs.setBoolPref(PREF_APP_UPDATE_METRO_ENABLED, true);
-
if (Services.prefs.prefHasUserValue(PREF_APP_UPDATE_SERVICE_ENABLED)) {
gAppUpdateServiceEnabled = Services.prefs.getBoolPref(PREF_APP_UPDATE_SERVICE_ENABLED);
}
@@ -983,13 +977,6 @@ function resetPrefs() {
Services.prefs.clearUserPref(PREF_APP_UPDATE_ENABLED);
}
- if (gAppUpdateMetroEnabled !== undefined) {
- Services.prefs.setBoolPref(PREF_APP_UPDATE_METRO_ENABLED, gAppUpdateMetroEnabled);
- }
- else if (Services.prefs.prefHasUserValue(PREF_APP_UPDATE_METRO_ENABLED)) {
- Services.prefs.clearUserPref(PREF_APP_UPDATE_METRO_ENABLED);
- }
-
if (gAppUpdateServiceEnabled !== undefined) {
Services.prefs.setBoolPref(PREF_APP_UPDATE_SERVICE_ENABLED, gAppUpdateServiceEnabled);
}
diff --git a/toolkit/mozapps/update/tests/shared.js b/toolkit/mozapps/update/tests/shared.js
index 5a5aa8ae2..d70179654 100644
--- a/toolkit/mozapps/update/tests/shared.js
+++ b/toolkit/mozapps/update/tests/shared.js
@@ -22,7 +22,6 @@ const PREF_APP_UPDATE_CERT_MAXERRORS = "app.update.cert.maxErrors";
const PREF_APP_UPDATE_CERT_REQUIREBUILTIN = "app.update.cert.requireBuiltIn";
const PREF_APP_UPDATE_CHANNEL = "app.update.channel";
const PREF_APP_UPDATE_ENABLED = "app.update.enabled";
-const PREF_APP_UPDATE_METRO_ENABLED = "app.update.metro.enabled";
const PREF_APP_UPDATE_IDLETIME = "app.update.idletime";
const PREF_APP_UPDATE_LOG = "app.update.log";
const PREF_APP_UPDATE_NEVER_BRANCH = "app.update.never.";
diff --git a/toolkit/mozapps/update/tests/unit_aus_update/head_update.js b/toolkit/mozapps/update/tests/unit_aus_update/head_update.js
index 8bdc090f7..624932f30 100644
--- a/toolkit/mozapps/update/tests/unit_aus_update/head_update.js
+++ b/toolkit/mozapps/update/tests/unit_aus_update/head_update.js
@@ -1047,7 +1047,6 @@ function doTestFinish() {
*/
function setDefaultPrefs() {
Services.prefs.setBoolPref(PREF_APP_UPDATE_ENABLED, true);
- Services.prefs.setBoolPref(PREF_APP_UPDATE_METRO_ENABLED, true);
// Don't display UI for a successful installation. Some apps may not set this
// pref to false like Firefox does.
Services.prefs.setBoolPref(PREF_APP_UPDATE_SHOW_INSTALLED_UI, false);
diff --git a/toolkit/mozapps/update/updater/updater.cpp b/toolkit/mozapps/update/updater/updater.cpp
index 756455d38..204c6c72f 100644
--- a/toolkit/mozapps/update/updater/updater.cpp
+++ b/toolkit/mozapps/update/updater/updater.cpp
@@ -70,7 +70,6 @@
#else
#define PARENT_WAIT 10000
#endif
-#define IMMERSIVE_PARENT_WAIT 15000
#if defined(XP_MACOSX)
// These functions are defined in launchchild_osx.mm
@@ -1804,23 +1803,6 @@ PatchIfFile::Finish(int status)
#include "uachelper.h"
#include "pathhash.h"
-#ifdef MOZ_METRO
-/**
- * Determines if the update came from an Immersive browser
- * @return true if the update came from an immersive browser
- */
-bool
-IsUpdateFromMetro(int argc, NS_tchar **argv)
-{
- for (int i = 0; i < argc; i++) {
- if (!wcsicmp(L"-ServerName:DefaultBrowserServer", argv[i])) {
- return true;
- }
- }
- return false;
-}
-#endif
-
/**
* Launch the post update application (helper.exe). It takes in the path of the
* callback application to calculate the path of helper.exe.
@@ -2624,15 +2606,10 @@ int NS_main(int argc, NS_tchar **argv)
// Otherwise, wait for the parent process to exit before starting the
// update.
if (parent) {
- bool updateFromMetro = false;
-#ifdef MOZ_METRO
- updateFromMetro = IsUpdateFromMetro(argc, argv);
-#endif
- DWORD waitTime = updateFromMetro ?
- IMMERSIVE_PARENT_WAIT : PARENT_WAIT;
+ DWORD waitTime = PARENT_WAIT;
DWORD result = WaitForSingleObject(parent, waitTime);
CloseHandle(parent);
- if (result != WAIT_OBJECT_0 && !updateFromMetro)
+ if (result != WAIT_OBJECT_0)
return 1;
}
}