Bug 1238310: Part 1 - Allow setting zoom for background tabs. r=adw
authorKris Maglione <maglione.k@gmail.com>
Fri, 01 Apr 2016 15:16:52 -0700
changeset 332379 517ccf702ca23a525440b0617aae4dd9a88559f5
parent 332378 ef9c1cc0a76ca05d459cda0a0d74266f5d916341
child 332380 660fd42c40243a9011595b694347ea42af0da06d
push id6048
push userkmoir@mozilla.com
push dateMon, 06 Jun 2016 19:02:08 +0000
treeherdermozilla-beta@46d72a56c57d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersadw
bugs1238310
milestone48.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 1238310: Part 1 - Allow setting zoom for background tabs. r=adw MozReview-Commit-ID: F7zQ30P510g
browser/base/content/browser-fullZoom.js
--- a/browser/base/content/browser-fullZoom.js
+++ b/browser/base/content/browser-fullZoom.js
@@ -265,21 +265,30 @@ var FullZoom = {
   enlarge: function FullZoom_enlarge() {
     ZoomManager.enlarge();
     let browser = gBrowser.selectedBrowser;
     this._ignorePendingZoomAccesses(browser);
     this._applyZoomToPref(browser);
   },
 
   /**
-   * Sets the zoom level of the page in the current browser to the global zoom
+   * Sets the zoom level for the given browser to the given floating
+   * point value, where 1 is the default zoom level.
+   */
+  setZoom: function (value, browser = gBrowser.selectedBrowser) {
+    ZoomManager.setZoomForBrowser(browser, value);
+    this._ignorePendingZoomAccesses(browser);
+    this._applyZoomToPref(browser);
+  },
+
+  /**
+   * Sets the zoom level of the page in the given browser to the global zoom
    * level.
    */
-  reset: function FullZoom_reset() {
-    let browser = gBrowser.selectedBrowser;
+  reset: function FullZoom_reset(browser = gBrowser.selectedBrowser) {
     let token = this._getBrowserToken(browser);
     this._getGlobalValue(browser, function (value) {
       if (token.isCurrent) {
         ZoomManager.setZoomForBrowser(browser, value === undefined ? 1 : value);
         this._ignorePendingZoomAccesses(browser);
         this._executeSoon(function () {
           // _getGlobalValue may be either sync or async, so notify asyncly so
           // observers are guaranteed consistent behavior.