Commit 615e53a7 authored by Dão Gottwald's avatar Dão Gottwald
Browse files

Bug 1499706 - Remove external calls to TabsInTitlebar.update and make it private. r=mconley

Differential Revision: https://phabricator.services.mozilla.com/D11311

--HG--
extra : moz-landing-system : lando
parent dd3666f9
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -338,11 +338,6 @@ var FullScreen = {
      // This is needed if they use the context menu to quit fullscreen
      this._isPopupOpen = false;
      this.cleanup();
      // TabsInTitlebar skips appearance updates on resize events for exiting
      // fullscreen, since that happens before we change the UI here in the
      // "fullscreen" event. Hence we need to call it here to ensure the
      // appearance is properly updated. See bug 1173768.
      TabsInTitlebar.update();
    }

    if (enterFS && !document.fullscreenElement) {
+9 −9
Original line number Diff line number Diff line
@@ -10,18 +10,18 @@ var TabsInTitlebar = {

    gDragSpaceObserver.init();
    this._initialized = true;
    this.update();
    this._update();
  },

  allowedBy(condition, allow) {
    if (allow) {
      if (condition in this._disallowed) {
        delete this._disallowed[condition];
        this.update();
        this._update();
      }
    } else if (!(condition in this._disallowed)) {
      this._disallowed[condition] = null;
      this.update();
      this._update();
    }
  },

@@ -58,12 +58,13 @@ var TabsInTitlebar = {
                   Services.prefs.getBoolPref(this._prefName));
  },

  update() {
    if (!this._initialized || window.fullScreen) {
  _update() {
    if (!this._initialized) {
      return;
    }

    let allowed = this.systemSupported &&
                  !window.fullScreen &&
                  (Object.keys(this._disallowed)).length == 0;
    if (allowed) {
      document.documentElement.setAttribute("tabsintitlebar", "true");
@@ -103,7 +104,7 @@ var gDragSpaceObserver = {
  pref: "browser.tabs.extraDragSpace",

  init() {
    this.update();
    this._update();
    Services.prefs.addObserver(this.pref, this);
  },

@@ -116,15 +117,14 @@ var gDragSpaceObserver = {
      return;
    }

    this.update();
    this._update();
  },

  update() {
  _update() {
    if (Services.prefs.getBoolPref(this.pref)) {
      document.documentElement.setAttribute("extradragspace", "true");
    } else {
      document.documentElement.removeAttribute("extradragspace");
    }
    TabsInTitlebar.update();
  },
};
+0 −2
Original line number Diff line number Diff line
@@ -7389,14 +7389,12 @@ const gAccessibilityServiceIndicator = {
      [...document.querySelectorAll(".accessibility-indicator")].forEach(
        indicator => ["click", "keypress"].forEach(type =>
          indicator.addEventListener(type, this)));
      TabsInTitlebar.update();
    } else if (this._active) {
      this._active = false;
      document.documentElement.removeAttribute("accessibilitymode");
      [...document.querySelectorAll(".accessibility-indicator")].forEach(
        indicator => ["click", "keypress"].forEach(type =>
          indicator.removeEventListener(type, this)));
      TabsInTitlebar.update();
    }
  },