Bug 1238310: Part 1 - Allow setting zoom for background tabs. r?adw
MozReview-Commit-ID: F7zQ30P510g
--- 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.