diff options
Diffstat (limited to 'toolkit')
23 files changed, 24 insertions, 623 deletions
diff --git a/toolkit/components/crashmonitor/CrashMonitor.jsm b/toolkit/components/crashmonitor/CrashMonitor.jsm index 17e0ddfb7..b23508c61 100644 --- a/toolkit/components/crashmonitor/CrashMonitor.jsm +++ b/toolkit/components/crashmonitor/CrashMonitor.jsm @@ -84,13 +84,9 @@ let CrashMonitorInternal = { * Path to checkpoint file. * * Each time a new notification is received, this file is written to - * disc to reflect the information in |checkpoints|. Although Firefox for - * Desktop and Metro share the same profile, they need to keep record of - * crashes separately. + * disc to reflect the information in |checkpoints|. */ - path: (Services.metro && Services.metro.immersive) ? - OS.Path.join(OS.Constants.Path.profileDir, "metro", "sessionCheckpoints.json"): - OS.Path.join(OS.Constants.Path.profileDir, "sessionCheckpoints.json"), + path: OS.Path.join(OS.Constants.Path.profileDir, "sessionCheckpoints.json"), /** * Load checkpoints from previous session asynchronously. @@ -178,9 +174,6 @@ this.CrashMonitor = { ); CrashMonitorInternal.initialized = true; - if (Services.metro && Services.metro.immersive) { - OS.File.makeDir(OS.Path.join(OS.Constants.Path.profileDir, "metro")); - } return promise; }, diff --git a/toolkit/components/downloads/nsDownloadManager.cpp b/toolkit/components/downloads/nsDownloadManager.cpp index df256a0cb..8c63f1392 100644 --- a/toolkit/components/downloads/nsDownloadManager.cpp +++ b/toolkit/components/downloads/nsDownloadManager.cpp @@ -947,13 +947,8 @@ nsDownloadManager::Init() // When MOZ_JSDOWNLOADS is undefined, we still check the preference that can // be used to enable the JavaScript API during the migration process. mUseJSTransfer = Preferences::GetBool(PREF_BD_USEJSTRANSFER, false); -#elif defined(XP_WIN) - // When MOZ_JSDOWNLOADS is defined on Windows, this component is disabled - // unless we are running in Windows Metro. The conversion of Windows Metro - // to use the JavaScript API for downloads is tracked in bug 906042. - mUseJSTransfer = !IsRunningInWindowsMetro(); #else - mUseJSTransfer = true; + mUseJSTransfer = true; #endif if (mUseJSTransfer) diff --git a/toolkit/components/jsdownloads/src/DownloadIntegration.jsm b/toolkit/components/jsdownloads/src/DownloadIntegration.jsm index 7e9a6348f..2ed769371 100644 --- a/toolkit/components/jsdownloads/src/DownloadIntegration.jsm +++ b/toolkit/components/jsdownloads/src/DownloadIntegration.jsm @@ -457,13 +457,7 @@ this.DownloadIntegration = { #elifdef MOZ_WIDGET_GONK directoryPath = yield this.getSystemDownloadsDirectory(); #else - // For Metro mode on Windows 8, we want searchability for documents - // that the user chose to open with an external application. - if (Services.metro && Services.metro.immersive) { - directoryPath = yield this.getSystemDownloadsDirectory(); - } else { - directoryPath = this._getDirectory("TmpD"); - } + directoryPath = this._getDirectory("TmpD"); #endif throw new Task.Result(directoryPath); }.bind(this)); diff --git a/toolkit/components/startup/nsAppStartup.cpp b/toolkit/components/startup/nsAppStartup.cpp index 5b32ebcf4..629240add 100644 --- a/toolkit/components/startup/nsAppStartup.cpp +++ b/toolkit/components/startup/nsAppStartup.cpp @@ -143,7 +143,6 @@ nsAppStartup::nsAppStartup() : mInterrupted(false), mIsSafeModeNecessary(false), mStartupCrashTrackingEnded(false), - mRestartTouchEnvironment(false), mRestartNotSameProfile(false) { } @@ -284,9 +283,7 @@ nsAppStartup::Run(void) } nsresult retval = NS_OK; - if (mRestartTouchEnvironment) { - retval = NS_SUCCESS_RESTART_METRO_APP; - } else if (mRestart) { + if (mRestart) { retval = NS_SUCCESS_RESTART_APP; } else if (mRestartNotSameProfile) { retval = NS_SUCCESS_RESTART_APP_NOT_SAME_PROFILE; @@ -384,17 +381,12 @@ nsAppStartup::Quit(uint32_t aMode) gRestartMode = (aMode & 0xF0); } - if (!mRestartTouchEnvironment) { - mRestartTouchEnvironment = (aMode & eRestartTouchEnvironment) != 0; - gRestartMode = (aMode & 0xF0); - } - if (!mRestartNotSameProfile) { mRestartNotSameProfile = (aMode & eRestartNotSameProfile) != 0; gRestartMode = (aMode & 0xF0); } - if (mRestart || mRestartTouchEnvironment || mRestartNotSameProfile) { + if (mRestart || mRestartNotSameProfile) { // Mark the next startup as a restart. PR_SetEnv("MOZ_APP_RESTART=1"); @@ -464,7 +456,7 @@ nsAppStartup::Quit(uint32_t aMode) NS_NAMED_LITERAL_STRING(shutdownStr, "shutdown"); NS_NAMED_LITERAL_STRING(restartStr, "restart"); obsService->NotifyObservers(nullptr, "quit-application", - (mRestart || mRestartTouchEnvironment || mRestartNotSameProfile) ? + (mRestart || mRestartNotSameProfile) ? restartStr.get() : shutdownStr.get()); } @@ -591,14 +583,6 @@ nsAppStartup::GetWasRestarted(bool *aResult) } NS_IMETHODIMP -nsAppStartup::GetRestartingTouchEnvironment(bool *aResult) -{ - NS_ENSURE_ARG_POINTER(aResult); - *aResult = mRestartTouchEnvironment; - return NS_OK; -} - -NS_IMETHODIMP nsAppStartup::SetInterrupted(bool aInterrupted) { mInterrupted = aInterrupted; diff --git a/toolkit/components/startup/nsAppStartup.h b/toolkit/components/startup/nsAppStartup.h index 7b586040c..7f8b9bd61 100644 --- a/toolkit/components/startup/nsAppStartup.h +++ b/toolkit/components/startup/nsAppStartup.h @@ -62,7 +62,6 @@ private: bool mInterrupted; // Was startup interrupted by an interactive prompt? bool mIsSafeModeNecessary; // Whether safe mode is necessary bool mStartupCrashTrackingEnded; // Whether startup crash tracking has already ended - bool mRestartTouchEnvironment; // Quit (eRestartTouchEnvironment) bool mRestartNotSameProfile; // Quit(eRestartNotSameProfile) #if defined(XP_WIN) diff --git a/toolkit/components/startup/public/nsIAppStartup.idl b/toolkit/components/startup/public/nsIAppStartup.idl index 8edf6b026..b6c899798 100644 --- a/toolkit/components/startup/public/nsIAppStartup.idl +++ b/toolkit/components/startup/public/nsIAppStartup.idl @@ -32,11 +32,6 @@ interface nsIAppStartup : nsISupports * This return code indicates that the application should be * restarted because quit was called with the eRestart flag. - * @returnCode NS_SUCCESS_RESTART_METRO_APP - * This return code indicates that the application should be - * restarted in metro because quit was called with the - * eRestartTouchEnviroment flag. - * @returnCode NS_SUCCESS_RESTART_APP_NOT_SAME_PROFILE * This return code indicates that the application should be * restarted without necessarily using the same profile because @@ -133,13 +128,6 @@ interface nsIAppStartup : nsISupports const uint32_t eRestartx86_64 = 0x40; /** - * Restart the application in a touch-optimized environment (such as Metro) - * after quitting. The application will be restarted with the same profile - * and an empty command line. - */ - const uint32_t eRestartTouchEnvironment = 0x80; - - /** * Restart the application after quitting. The application will be * restarted with an empty command line and the normal profile selection * process will take place on startup. @@ -185,12 +173,6 @@ interface nsIAppStartup : nsISupports */ readonly attribute boolean wasRestarted; - /** - * True if the application is being restarted in a touch-optimized - * environment (such as Metro). - */ - readonly attribute boolean restartingTouchEnvironment; - /** * Returns an object with main, process, firstPaint, sessionRestored properties. * Properties may not be available depending on platform or application diff --git a/toolkit/content/widgets/browser.xml b/toolkit/content/widgets/browser.xml index b05825210..e0b13dd24 100644 --- a/toolkit/content/widgets/browser.xml +++ b/toolkit/content/widgets/browser.xml @@ -658,7 +658,7 @@ <field name="blockedPopups">null</field> - <!-- Obsolete name for blockedPopups. Used by metro and android. --> + <!-- Obsolete name for blockedPopups. Used by android. --> <property name="pageReport" onget="return this.blockedPopups;" readonly="true"/> diff --git a/toolkit/library/moz.build b/toolkit/library/moz.build index 98d42392f..1489d2fd3 100644 --- a/toolkit/library/moz.build +++ b/toolkit/library/moz.build @@ -28,13 +28,6 @@ def Libxul(name): 'winspool.drv' ] - if CONFIG['MOZ_METRO']: - DELAYLOAD_DLLS += [ - 'API-MS-WIN-CORE-WINRT-L' + CONFIG['CRTEXPDLLVERSION'] + '.DLL', - 'API-MS-WIN-CORE-WINRT-STRING-L' + CONFIG['CRTEXPDLLVERSION'] + '.DLL', - 'uiautomationcore.dll' - ] - if CONFIG['ACCESSIBILITY']: DELAYLOAD_DLLS += ['oleacc.dll'] @@ -359,11 +352,6 @@ if CONFIG['OS_ARCH'] == 'WINNT': OS_LIBS += [ 'oleacc', ] - if CONFIG['MOZ_METRO']: - OS_LIBS += [ - 'uiautomationcore', - 'runtimeobject', - ] if CONFIG['MOZ_ENABLE_QT']: OS_LIBS += CONFIG['XEXT_LIBS'] diff --git a/toolkit/locales/en-US/chrome/places/places.properties b/toolkit/locales/en-US/chrome/places/places.properties index 8b543b8e4..30acd912b 100644 --- a/toolkit/locales/en-US/chrome/places/places.properties +++ b/toolkit/locales/en-US/chrome/places/places.properties @@ -29,8 +29,3 @@ localhost=(local files) # %1$S is the file size # %2$S is the file size unit backupFileSizeText=%1$S %2$S - -# LOCALIZATION NOTE (windows8TouchTitle): this is the name of the folder used -# to store bookmarks created in Metro mode and share bookmarks between Metro -# and Desktop. -windows8TouchTitle=Windows 8 Touch
\ No newline at end of file diff --git a/toolkit/modules/Finder.jsm b/toolkit/modules/Finder.jsm index d4d430d04..b4e0959f8 100644 --- a/toolkit/modules/Finder.jsm +++ b/toolkit/modules/Finder.jsm @@ -501,7 +501,11 @@ Finder.prototype = { }, _getWindow: function () { - return this._docShell.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindow); + try { + return this._docShell.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindow); + } catch(e) { + Cu.reportError(e); + } }, /** diff --git a/toolkit/mozapps/installer/windows/nsis/common.nsh b/toolkit/mozapps/installer/windows/nsis/common.nsh index 636c6488d..39896b8f1 100644 --- a/toolkit/mozapps/installer/windows/nsis/common.nsh +++ b/toolkit/mozapps/installer/windows/nsis/common.nsh @@ -7803,128 +7803,3 @@ Exch $0 ; return elapsed seconds !macroend -!ifdef MOZ_METRO -; Removes the CEH registration if it's set to our installation directory. -; If it's set to some other installation directory, then it should be removed -; by that installation. -!macro RemoveDEHRegistrationIfMatchingCall un - - Function ${un}RemoveDEHRegistrationIfMatchingCall - ; Retrieve DEH ID from the stack into $R9 - Exch $R9 - Exch 1 - - ; Retrieve Protocol Activation ID from stack into $R8 - Exch $R8 - Exch 2 - - ; Retrieve File Activation ID from stack into $R7 - Exch $R7 - - ; Backup the old values of R6 and R5 on the stack - Push $R6 - Push $R5 - - ; Conditionally remove the DEH as long as we are the default (HKCU) - ReadRegStr $R6 HKCU "Software\Classes\CLSID\$R9\LocalServer32" "" - ${${un}GetLongPath} "$INSTDIR" $R5 - StrCmp "$R6" "" next +1 - IfFileExists "$R6" +1 clearHKCU - ${${un}GetParent} "$R6" $R6 - ${${un}GetLongPath} "$R6" $R6 - StrCmp "$R5" "$R6" clearHKCU next - clearHKCU: - DeleteRegKey HKCU "Software\Classes\CLSID\$R9" - DeleteRegValue HKCU "Software\Classes\$R8\shell\open\command" "DelegateExecute" - DeleteRegValue HKCU "Software\Classes\$R7\shell\open\command" "DelegateExecute" - next: - - ; Conditionally remove the DEH as long as we are the default (HKLM) - ReadRegStr $R6 HKLM "Software\Classes\CLSID\$R9\LocalServer32" "" - ${${un}GetLongPath} "$INSTDIR" $R5 - StrCmp "$R6" "" done +1 - IfFileExists "$R6" +1 clearHKLM - ${${un}GetParent} "$R6" $R6 - ${${un}GetLongPath} "$R6" $R6 - StrCmp "$R5" "$R6" clearHKLM done - clearHKLM: - DeleteRegKey HKLM "Software\Classes\CLSID\$R9" - DeleteRegValue HKLM "Software\Classes\$R8\shell\open\command" "DelegateExecute" - DeleteRegValue HKLM "Software\Classes\$R7\shell\open\command" "DelegateExecute" - done: - - ; Always remove the AppUserModelID keys for this installation - DeleteRegKey HKCU "Software\Classes\$AppUserModelID" - DeleteRegKey HKLM "Software\Classes\$AppUserModelID" - - ; Restore the registers back to their original state - Pop $R5 - Pop $R6 - Exch $R7 - Exch 2 - Exch $R8 - Exch 1 - Exch $R9 - FunctionEnd -!macroend - -!macro RemoveDEHRegistrationIfMatching - !insertmacro RemoveDEHRegistrationIfMatchingCall "" -!macroend - -!macro un.RemoveDEHRegistrationIfMatching - !insertmacro RemoveDEHRegistrationIfMatchingCall "un." -!macroend - -!macro CleanupMetroBrowserHandlerValues un DELEGATE_EXECUTE_HANDLER_ID \ - PROTOCOL_ACTIVATION_ID \ - FILE_ACTIVATION_ID - Push ${FILE_ACTIVATION_ID} - Push ${PROTOCOL_ACTIVATION_ID} - Push ${DELEGATE_EXECUTE_HANDLER_ID} - Call ${un}RemoveDEHRegistrationIfMatchingCall -!macroend -!define CleanupMetroBrowserHandlerValues '!insertmacro CleanupMetroBrowserHandlerValues ""' -!define un.CleanupMetroBrowserHandlerValues '!insertmacro CleanupMetroBrowserHandlerValues "un."' - -!macro AddMetroBrowserHandlerValues DELEGATE_EXECUTE_HANDLER_ID \ - DELEGATE_EXECUTE_HANDLER_PATH \ - APP_USER_MODEL_ID \ - PROTOCOL_ACTIVATION_ID \ - FILE_ACTIVATION_ID - ; Win8 doesn't use conventional progid command data to launch anymore. - ; Instead it uses a delegate execute handler which is a light weight COM - ; server for choosing the metro or desktop browser to launch depending - ; on the current environment (metro/desktop) it was activated in. - WriteRegStr SHCTX "Software\Classes\${APP_USER_MODEL_ID}" "" "" - WriteRegStr SHCTX "Software\Classes\${APP_USER_MODEL_ID}\.exe" "" "" - WriteRegStr SHCTX "Software\Classes\${APP_USER_MODEL_ID}\.exe\shell" "" "open" - WriteRegStr SHCTX "Software\Classes\${APP_USER_MODEL_ID}\.exe\shell\open" "CommandId" "open" - WriteRegStr SHCTX "Software\Classes\${APP_USER_MODEL_ID}\.exe\shell\open\command" "" "$2" - WriteRegStr SHCTX "Software\Classes\${APP_USER_MODEL_ID}\.exe\shell\open\command" "DelegateExecute" "${DELEGATE_EXECUTE_HANDLER_ID}" - - ; Augment the url handler registrations with additional data needed for Metro - WriteRegStr SHCTX "Software\Classes\${PROTOCOL_ACTIVATION_ID}" "AppUserModelID" "${APP_USER_MODEL_ID}" - WriteRegStr SHCTX "Software\Classes\${PROTOCOL_ACTIVATION_ID}\Application" "AppUserModelID" "${APP_USER_MODEL_ID}" - WriteRegStr SHCTX "Software\Classes\${PROTOCOL_ACTIVATION_ID}\Application" "ApplicationName" "$BrandShortName" - WriteRegStr SHCTX "Software\Classes\${PROTOCOL_ACTIVATION_ID}\Application" "ApplicationIcon" "$INSTDIR\${FileMainEXE},0" - WriteRegStr SHCTX "Software\Classes\${PROTOCOL_ACTIVATION_ID}\Application" "ApplicationCompany" "${CompanyName}" - WriteRegStr SHCTX "Software\Classes\${PROTOCOL_ACTIVATION_ID}\Application" "ApplicationDescription" "$(REG_APP_DESC)" - WriteRegStr SHCTX "Software\Classes\${PROTOCOL_ACTIVATION_ID}\shell" "" "open" - WriteRegStr SHCTX "Software\Classes\${PROTOCOL_ACTIVATION_ID}\shell\open" "CommandId" "open" - WriteRegStr SHCTX "Software\Classes\${PROTOCOL_ACTIVATION_ID}\shell\open\command" "DelegateExecute" "${DELEGATE_EXECUTE_HANDLER_ID}" - - ; Augment the file handler registrations with additional data needed for Metro - WriteRegStr SHCTX "Software\Classes\${FILE_ACTIVATION_ID}" "AppUserModelID" "${APP_USER_MODEL_ID}" - WriteRegStr SHCTX "Software\Classes\${FILE_ACTIVATION_ID}\shell" "" "open" - WriteRegStr SHCTX "Software\Classes\${FILE_ACTIVATION_ID}\shell\open" "CommandId" "open" - WriteRegStr SHCTX "Software\Classes\${FILE_ACTIVATION_ID}\shell\open\command" "DelegateExecute" "${DELEGATE_EXECUTE_HANDLER_ID}" - - ; Win8 Metro delegate execute handler registration - WriteRegStr SHCTX "Software\Classes\CLSID\${DELEGATE_EXECUTE_HANDLER_ID}" "" "$BrandShortName CommandExecuteHandler" - WriteRegStr SHCTX "Software\Classes\CLSID\${DELEGATE_EXECUTE_HANDLER_ID}" "AppId" "${DELEGATE_EXECUTE_HANDLER_ID}" - WriteRegStr SHCTX "Software\Classes\CLSID\${DELEGATE_EXECUTE_HANDLER_ID}\LocalServer32" "" "${DELEGATE_EXECUTE_HANDLER_PATH}" -!macroend -!define AddMetroBrowserHandlerValues "!insertmacro AddMetroBrowserHandlerValues" -!endif ;end MOZ_METRO - 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; } } diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp index 2964d900a..9b015619b 100644 --- a/toolkit/xre/nsAppRunner.cpp +++ b/toolkit/xre/nsAppRunner.cpp @@ -95,9 +95,6 @@ #include <windows.h> #include "cairo/cairo-features.h" #include "mozilla/WindowsVersion.h" -#ifdef MOZ_METRO -#include <roapi.h> -#endif #ifndef PROCESS_DEP_ENABLE #define PROCESS_DEP_ENABLE 0x1 @@ -126,10 +123,6 @@ #include "nsXREDirProvider.h" #include "nsToolkitCompsCID.h" -#if defined(XP_WIN) && defined(MOZ_METRO) -#include "updatehelper.h" -#endif - #include "nsINIParser.h" #include "mozilla/Omnijar.h" #include "mozilla/StartupTimeline.h" @@ -566,16 +559,13 @@ ProcessDDE(nsINativeAppSupport* aNative, bool aWait) /** * Determines if there is support for showing the profile manager * - * @return true in all environments except for Windows Metro + * @return currently true in all environments + * XXX: This was false for Metro. Possibly remove this logic. */ static bool CanShowProfileManager() { -#if defined(XP_WIN) - return XRE_GetWindowsEnvironment() == WindowsEnvironmentType_Desktop; -#else return true; -#endif } static bool @@ -2688,38 +2678,6 @@ static DWORD WINAPI InitDwriteBG(LPVOID lpdwThreadParam) bool fire_glxtest_process(); #endif -#if defined(XP_WIN) && defined(MOZ_METRO) -#ifndef AHE_TYPE -enum AHE_TYPE { - AHE_DESKTOP = 0, - AHE_IMMERSIVE = 1 -}; -#endif - -/* - * The Windows launcher uses this value to decide what front end ui - * to launch. We always launch the same ui unless the user - * specifically asks to switch. Update the value on every startup - * based on the environment requested. - */ -void -SetLastWinRunType(AHE_TYPE aType) -{ - HKEY key; - LONG result = RegOpenKeyExW(HKEY_CURRENT_USER, - L"SOFTWARE\\Mozilla\\Firefox", - 0, KEY_WRITE, &key); - if (result != ERROR_SUCCESS) { - return; - } - DWORD value = (DWORD)aType; - result = RegSetValueEx(key, L"MetroLastAHE", 0, REG_DWORD, - reinterpret_cast<LPBYTE>(&value), - sizeof(DWORD)); - RegCloseKey(key); -} -#endif // defined(XP_WIN) && defined(MOZ_METRO) - #include "GoannaProfiler.h" // Encapsulates startup and shutdown state for XRE_main @@ -2811,19 +2769,6 @@ XREMain::XRE_mainInit(bool* aExitFlag) fire_glxtest_process(); #endif -#if defined(XP_WIN) && defined(MOZ_METRO) - // Don't remove this arg, we want to pass it on to nsUpdateDriver - if (CheckArg("metro-update", false, nullptr, false) == ARG_FOUND || - XRE_GetWindowsEnvironment() == WindowsEnvironmentType_Metro) { - // If we're doing a restart update that was initiated from metro land, - // we'll be running desktop to handle the actual update. Request that - // after the restart we launch into metro. - SetLastWinRunType(AHE_IMMERSIVE); - } else { - SetLastWinRunType(AHE_DESKTOP); - } -#endif - SetupErrorHandling(gArgv[0]); #ifdef CAIRO_HAS_DWRITE_FONT @@ -3406,12 +3351,6 @@ XREMain::XRE_mainStartup(bool* aExitFlag) *aExitFlag = true; return 0; } -#if defined(XP_WIN) && defined(MOZ_METRO) - if (CheckArg("metro-update", false) == ARG_FOUND) { - *aExitFlag = true; - return 0; - } -#endif #endif rv = NS_NewToolkitProfileService(getter_AddRefs(mProfileSvc)); @@ -3868,7 +3807,6 @@ XREMain::XRE_main(int argc, char* argv[], const nsXREAppData* aAppData) // Check for an application initiated restart. This is one that // corresponds to nsIAppStartup.quit(eRestart) if (rv == NS_SUCCESS_RESTART_APP - || rv == NS_SUCCESS_RESTART_METRO_APP || rv == NS_SUCCESS_RESTART_APP_NOT_SAME_PROFILE) { appInitiatedRestart = true; @@ -3912,15 +3850,7 @@ XREMain::XRE_main(int argc, char* argv[], const nsXREAppData* aAppData) MOZ_gdk_display_close(mGdkDisplay); #endif -#if defined(MOZ_METRO) && defined(XP_WIN) - if (rv == NS_SUCCESS_RESTART_METRO_APP) { - LaunchDefaultMetroBrowser(); - rv = NS_OK; - } else -#endif - { - rv = LaunchChild(mNativeApp, true); - } + rv = LaunchChild(mNativeApp, true); return rv == NS_ERROR_LAUNCHED_CHILD_PROCESS ? 0 : 1; } @@ -3936,173 +3866,18 @@ XREMain::XRE_main(int argc, char* argv[], const nsXREAppData* aAppData) return NS_FAILED(rv) ? 1 : 0; } -#if defined(MOZ_METRO) && defined(XP_WIN) -extern bool XRE_MetroCoreApplicationRun(); -static XREMain* xreMainPtr; - -// must be called by the thread we want as the main thread -nsresult -XRE_metroStartup(bool runXREMain) -{ - nsresult rv; - - // XXX This call, odly enough, will set this thread as - // the main thread. (see bug 1033358) - ScopedLogging log; - - bool exit = false; - if (xreMainPtr->XRE_mainStartup(&exit) != 0 || exit) - return NS_ERROR_FAILURE; - - // Start the real application - xreMainPtr->mScopedXPCOM = MakeUnique<ScopedXPCOMStartup>(); - if (!xreMainPtr->mScopedXPCOM) - return NS_ERROR_FAILURE; - - rv = xreMainPtr->mScopedXPCOM->Initialize(); - NS_ENSURE_SUCCESS(rv, rv); - - if (runXREMain) { - rv = xreMainPtr->XRE_mainRun(); - NS_ENSURE_SUCCESS(rv, rv); - } - return NS_OK; -} - -void -XRE_metroShutdown() -{ - xreMainPtr->mScopedXPCOM = nullptr; - -#ifdef MOZ_INSTRUMENT_EVENT_LOOP - mozilla::ShutdownEventTracing(); -#endif - - // unlock the profile after ScopedXPCOMStartup object (xpcom) - // has gone out of scope. see bug #386739 for more details - xreMainPtr->mProfileLock->Unlock(); - gProfileLock = nullptr; - - XRE_DeinitCommandLine(); -} - -class WinRTInitWrapper -{ -public: - WinRTInitWrapper() { - mResult = ::RoInitialize(RO_INIT_MULTITHREADED); - } - ~WinRTInitWrapper() { - if (SUCCEEDED(mResult)) { - ::RoUninitialize(); - } - } - HRESULT mResult; -}; - -int -XRE_mainMetro(int argc, char* argv[], const nsXREAppData* aAppData) -{ - char aLocal; - GoannaProfilerInitRAII profilerGuard(&aLocal); - - PROFILER_LABEL("Startup", "XRE_Main", - js::ProfileEntry::Category::OTHER); - - mozilla::IOInterposerInit ioInterposerGuard; - - nsresult rv = NS_OK; - - xreMainPtr = new XREMain(); - if (!xreMainPtr) { - return 1; - } - - // Inits Winrt and COM underneath it. - WinRTInitWrapper wrap; - - gArgc = argc; - gArgv = argv; - - NS_ENSURE_TRUE(aAppData, 2); - - xreMainPtr->mAppData = new ScopedAppData(aAppData); - if (!xreMainPtr->mAppData) - return 1; - // used throughout this file - gAppData = xreMainPtr->mAppData; - - // init - bool exit = false; - if (xreMainPtr->XRE_mainInit(&exit) != 0 || exit) - return 1; - - // Located in widget, will call back into XRE_metroStartup and - // XRE_metroShutdown above. - if (!XRE_MetroCoreApplicationRun()) { - return 1; - } - - // XRE_metroShutdown should have already been called on the worker - // thread that called XRE_metroStartup. - NS_ASSERTION(!xreMainPtr->mScopedXPCOM, - "XPCOM Shutdown hasn't occured, and we are exiting."); - return 0; -} - -void SetWindowsEnvironment(WindowsEnvironmentType aEnvID); -#endif // MOZ_METRO || !defined(XP_WIN) - void XRE_StopLateWriteChecks(void) { mozilla::StopLateWriteChecks(); } -// Separate stub function to let us specifically suppress it in Valgrind -void -XRE_CreateStatsObject() -{ - // A initializer to initialize histogram collection, a chromium - // thing used by Telemetry (and effectively a global; it's all static). - // Note: purposely leaked - base::StatisticsRecorder* statistics_recorder = new base::StatisticsRecorder(); - MOZ_LSAN_INTENTIONALLY_LEAK_OBJECT(statistics_recorder); - unused << statistics_recorder; -} - int XRE_main(int argc, char* argv[], const nsXREAppData* aAppData, uint32_t aFlags) { -#if !defined(MOZ_METRO) || !defined(XP_WIN) XREMain main; - - XRE_CreateStatsObject(); int result = main.XRE_main(argc, argv, aAppData); mozilla::RecordShutdownEndTimeStamp(); return result; -#else - if (aFlags == XRE_MAIN_FLAG_USE_METRO) { - SetWindowsEnvironment(WindowsEnvironmentType_Metro); - } - - // Desktop - if (XRE_GetWindowsEnvironment() == WindowsEnvironmentType_Desktop) { - XREMain main; - int result = main.XRE_main(argc, argv, aAppData); - mozilla::RecordShutdownEndTimeStamp(); - return result; - } - - // Metro - NS_ASSERTION(XRE_GetWindowsEnvironment() == WindowsEnvironmentType_Metro, - "Unknown Windows environment"); - - SetLastWinRunType(AHE_IMMERSIVE); - - int result = XRE_mainMetro(argc, argv, aAppData); - mozilla::RecordShutdownEndTimeStamp(); - return result; -#endif // MOZ_METRO || !defined(XP_WIN) } nsresult diff --git a/toolkit/xre/nsEmbedFunctions.cpp b/toolkit/xre/nsEmbedFunctions.cpp index b6b459817..07dac1810 100644 --- a/toolkit/xre/nsEmbedFunctions.cpp +++ b/toolkit/xre/nsEmbedFunctions.cpp @@ -796,23 +796,6 @@ XRE_InstallX11ErrorHandler() } #endif -#ifdef XP_WIN -static WindowsEnvironmentType -sWindowsEnvironmentType = WindowsEnvironmentType_Desktop; - -void -SetWindowsEnvironment(WindowsEnvironmentType aEnvID) -{ - sWindowsEnvironmentType = aEnvID; -} - -WindowsEnvironmentType -XRE_GetWindowsEnvironment() -{ - return sWindowsEnvironmentType; -} -#endif // XP_WIN - #ifdef MOZ_B2G_LOADER extern const nsXREAppData* gAppData; diff --git a/toolkit/xre/nsUpdateDriver.cpp b/toolkit/xre/nsUpdateDriver.cpp index 814d598d2..7050e519a 100644 --- a/toolkit/xre/nsUpdateDriver.cpp +++ b/toolkit/xre/nsUpdateDriver.cpp @@ -321,19 +321,6 @@ IsOlderVersion(nsIFile *versionFile, const char *appVersion) return false; } -#if defined(XP_WIN) && defined(MOZ_METRO) -static bool -IsWindowsMetroUpdateRequest(int appArgc, char **appArgv) -{ - for (int index = 0; index < appArgc; index++) { - if (!strcmp(appArgv[index], "--metro-update")) { - return true; - } - } - return false; -} -#endif - static bool CopyFileIntoUpdateDir(nsIFile *parentDir, const char *leafName, nsIFile *updateDir) { @@ -574,15 +561,7 @@ SwitchToUpdatedApp(nsIFile *greDir, nsIFile *updateDir, // just needs to replace the update directory. pid.AppendLiteral("/replace"); - int immersiveArgc = 0; -#if defined(XP_WIN) && defined(MOZ_METRO) - // If this is desktop doing an update for metro, or if we're the metro browser - // we want to launch the metro browser after we're finished. - if (IsWindowsMetroUpdateRequest(appArgc, appArgv) || IsRunningInWindowsMetro()) { - immersiveArgc = 1; - } -#endif - int argc = appArgc + 6 + immersiveArgc; + int argc = appArgc + 6; char **argv = new char*[argc + 1]; if (!argv) return; @@ -596,11 +575,6 @@ SwitchToUpdatedApp(nsIFile *greDir, nsIFile *updateDir, argv[6] = (char*) appFilePath.get(); for (int i = 1; i < appArgc; ++i) argv[6 + i] = appArgv[i]; -#ifdef XP_WIN - if (immersiveArgc) { - argv[argc - 1] = "-ServerName:DefaultBrowserServer"; - } -#endif argv[argc] = nullptr; } else { argc = 5; @@ -859,15 +833,7 @@ ApplyUpdate(nsIFile *greDir, nsIFile *updateDir, nsIFile *statusFile, #endif } - int immersiveArgc = 0; -#if defined(XP_WIN) && defined(MOZ_METRO) - // If this is desktop doing an update for metro, or if we're the metro browser - // we want to launch the metro browser after we're finished. - if (IsWindowsMetroUpdateRequest(appArgc, appArgv) || IsRunningInWindowsMetro()) { - immersiveArgc = 1; - } -#endif - int argc = appArgc + 6 + immersiveArgc; + int argc = appArgc + 6; char **argv = new char*[argc + 1 ]; if (!argv) return; @@ -881,11 +847,6 @@ ApplyUpdate(nsIFile *greDir, nsIFile *updateDir, nsIFile *statusFile, argv[6] = (char*) appFilePath.get(); for (int i = 1; i < appArgc; ++i) argv[6 + i] = appArgv[i]; -#ifdef XP_WIN - if (immersiveArgc) { - argv[argc - 1] = "-ServerName:DefaultBrowserServer"; - } -#endif argv[argc] = nullptr; } else { argc = 5; diff --git a/toolkit/xre/nsWindowsWMain.cpp b/toolkit/xre/nsWindowsWMain.cpp index dc3edc0ca..4ed4fed53 100644 --- a/toolkit/xre/nsWindowsWMain.cpp +++ b/toolkit/xre/nsWindowsWMain.cpp @@ -16,7 +16,7 @@ #include "nsSetDllDirectory.h" #endif -#if defined(MOZ_METRO) || defined(__GNUC__) +#if defined(__GNUC__) #define XRE_DONT_SUPPORT_XPSP2 #endif diff --git a/toolkit/xre/nsXREDirProvider.cpp b/toolkit/xre/nsXREDirProvider.cpp index c496a14ce..c1df66f0b 100644 --- a/toolkit/xre/nsXREDirProvider.cpp +++ b/toolkit/xre/nsXREDirProvider.cpp @@ -406,9 +406,6 @@ nsXREDirProvider::GetFile(const char* aProperty, bool* aPersistent, else if (!strcmp(aProperty, NS_APP_PREFS_50_FILE)) { rv = file->AppendNative(NS_LITERAL_CSTRING("prefs.js")); } - else if (!strcmp(aProperty, NS_METRO_APP_PREFS_50_FILE)) { - rv = file->AppendNative(NS_LITERAL_CSTRING("metro-prefs.js")); - } else if (!strcmp(aProperty, NS_LOCALSTORE_UNSAFE_FILE)) { rv = file->AppendNative(NS_LITERAL_CSTRING("localstore.rdf")); } @@ -1100,8 +1097,7 @@ nsXREDirProvider::GetUpdateRootDir(nsIFile* *aResult) // Get the local app data directory and if a vendor name exists append it. // If only a product name exists, append it. If neither exist fallback to // old handling. We don't use the product name on purpose because we want a - // shared update directory for different apps run from the same path (like - // Metro & Desktop). + // shared update directory for different apps run from the same path. nsCOMPtr<nsIFile> localDir; if (pathHashResult && (hasVendor || gAppData->name) && NS_SUCCEEDED(GetUserDataDirectoryHome(getter_AddRefs(localDir), true)) && |