Bug 931798 - Restore session after a switch to desktop/metro happens. r=emtwo
authorBrian R. Bondy <netzen@gmail.com>
Tue, 19 Nov 2013 13:18:20 -0500
changeset 172697 fb3ae66def36f3781fed5d4d819f07c279912ca0
parent 172696 ef5ef338cfcf733f8b35d73690915a672a848c98
child 172698 5257899d8b21d416137402dfa3bb485437c6574a
push id3224
push userlsblakk@mozilla.com
push dateTue, 04 Feb 2014 01:06:49 +0000
treeherdermozilla-beta@60c04d0987f1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersemtwo
bugs931798
milestone28.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 931798 - Restore session after a switch to desktop/metro happens. r=emtwo
browser/base/content/browser.js
browser/metro/base/content/appbar.js
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -2467,16 +2467,17 @@ function _checkDefaultAndSwitchToMetro()
   let shell = Components.classes["@mozilla.org/browser/shell-service;1"].
     getService(Components.interfaces.nsIShellService);
   let isDefault = shell.isDefaultBrowser(false, false);
 
   if (isDefault) {
     let appStartup = Components.classes["@mozilla.org/toolkit/app-startup;1"].
     getService(Components.interfaces.nsIAppStartup);
 
+    Services.prefs.setBoolPref('browser.sessionstore.resume_session_once', true);
     appStartup.quit(Components.interfaces.nsIAppStartup.eAttemptQuit |
                     Components.interfaces.nsIAppStartup.eRestartTouchEnvironment);
     return true;
   }
   return false;
 #endif
 #endif
 #endif
@@ -4687,17 +4688,18 @@ function fireSidebarFocusedEvent() {
 /**
  * Some prefs that have consequences in both Metro and Desktop such as
  * app-update prefs, are automatically pushed from Desktop here for use
  * in Metro.
  */
 var gMetroPrefs = {
   prefDomain: ["app.update.auto", "app.update.enabled",
                "app.update.service.enabled",
-               "app.update.metro.enabled"],
+               "app.update.metro.enabled",
+               "browser.sessionstore.resume_session_once"],
   observe: function (aSubject, aTopic, aPrefName)
   {
     if (aTopic != "nsPref:changed")
       return;
 
     this.pushDesktopControlledPrefToMetro(aPrefName);
   },
 
--- a/browser/metro/base/content/appbar.js
+++ b/browser/metro/base/content/appbar.js
@@ -142,16 +142,17 @@ var Appbar = {
 
       });
   },
 
   onViewOnDesktop: function() {
     let appStartup = Components.classes["@mozilla.org/toolkit/app-startup;1"].
       getService(Components.interfaces.nsIAppStartup);
 
+    Services.prefs.setBoolPref('browser.sessionstore.resume_session_once', true);
     appStartup.quit(Components.interfaces.nsIAppStartup.eAttemptQuit |
                     Components.interfaces.nsIAppStartup.eRestart);
   },
 
   onAutocompleteCloseButton: function () {
     Elements.autocomplete.closePopup();
   },