Bug 1509323 - Make gDragSpaceObserver private. r=johannh
authorDão Gottwald <dao@mozilla.com>
Fri, 23 Nov 2018 15:59:53 +0000
changeset 507083 55583f395c721df49ef7b19533471948ad0ea3de
parent 507082 f28667d0d2cbbb7e4f815433d5d24864188df2b2
child 507084 5283c43535adea04ee57afa232f0df4a876534ab
push id1905
push userffxbld-merge
push dateMon, 21 Jan 2019 12:33:13 +0000
treeherdermozilla-release@c2fca1944d8c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjohannh
bugs1509323
milestone65.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 1509323 - Make gDragSpaceObserver private. r=johannh Differential Revision: https://phabricator.services.mozilla.com/D12662
browser/base/content/browser-tabsintitlebar.js
--- a/browser/base/content/browser-tabsintitlebar.js
+++ b/browser/base/content/browser-tabsintitlebar.js
@@ -1,19 +1,23 @@
 /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*-
  * This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
-var TabsInTitlebar = {
+var TabsInTitlebar;
+
+{ // start private TabsInTitlebar scope
+
+TabsInTitlebar = {
   init() {
     this._readPref();
     Services.prefs.addObserver(this._prefName, this);
 
-    gDragSpaceObserver.init();
+    dragSpaceObserver.init();
     this._initialized = true;
     this._update();
   },
 
   allowedBy(condition, allow) {
     if (allow) {
       if (condition in this._disallowed) {
         delete this._disallowed[condition];
@@ -82,30 +86,23 @@ var TabsInTitlebar = {
       }
     }
 
     ToolbarIconColor.inferFromText("tabsintitlebar", allowed);
   },
 
   uninit() {
     Services.prefs.removeObserver(this._prefName, this);
-    gDragSpaceObserver.uninit();
+    dragSpaceObserver.uninit();
   },
 };
 
-function onTitlebarMaxClick() {
-  if (window.windowState == window.STATE_MAXIMIZED)
-    window.restore();
-  else
-    window.maximize();
-}
-
 // Adds additional drag space to the window by listening to
 // the corresponding preference.
-var gDragSpaceObserver = {
+let dragSpaceObserver = {
   pref: "browser.tabs.extraDragSpace",
 
   init() {
     Services.prefs.addObserver(this.pref, this);
     this.observe();
   },
 
   uninit() {
@@ -115,8 +112,17 @@ var gDragSpaceObserver = {
   observe() {
     if (Services.prefs.getBoolPref(this.pref)) {
       document.documentElement.setAttribute("extradragspace", "true");
     } else {
       document.documentElement.removeAttribute("extradragspace");
     }
   },
 };
+
+} // end private TabsInTitlebar scope
+
+function onTitlebarMaxClick() {
+  if (window.windowState == window.STATE_MAXIMIZED)
+    window.restore();
+  else
+    window.maximize();
+}