Commit 65c5bb52 authored by Gijs Kruitbosch's avatar Gijs Kruitbosch
Browse files

Merge m-c to ux

parents 9722d1a5 cb2571aa
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -96,7 +96,7 @@
      gQueue.push(new focusElmWhileSubdocIsFocused("link"));
      gQueue.push(new focusElmWhileSubdocIsFocused("link"));


      gQueue.push(new synthTab(editableDoc, new focusChecker(editableDoc)));
      gQueue.push(new synthTab(editableDoc, new focusChecker(editableDoc)));
      if (WIN) {
      if (WIN || LINUX) {
        // Alt key is used to active menubar and focus menu item on Windows,
        // Alt key is used to active menubar and focus menu item on Windows,
        // other platforms requires setting a ui.key.menuAccessKeyFocuses
        // other platforms requires setting a ui.key.menuAccessKeyFocuses
        // preference.
        // preference.
+1 −1
Original line number Original line Diff line number Diff line
@@ -156,7 +156,7 @@
      // Alt key is used to active menubar and focus menu item on Windows,
      // Alt key is used to active menubar and focus menu item on Windows,
      // other platforms requires setting a ui.key.menuAccessKeyFocuses
      // other platforms requires setting a ui.key.menuAccessKeyFocuses
      // preference.
      // preference.
      if (WIN) {
      if (WIN || LINUX) {
        gQueue.push(new focusFileMenu());
        gQueue.push(new focusFileMenu());
        gQueue.push(new focusEditMenu());
        gQueue.push(new focusEditMenu());
        gQueue.push(new leaveMenubar());
        gQueue.push(new leaveMenubar());
+1 −1
Original line number Original line Diff line number Diff line
@@ -11,7 +11,7 @@ module.metadata = {


const { Cu } = require('chrome');
const { Cu } = require('chrome');
const { Loader } = require('sdk/test/loader');
const { Loader } = require('sdk/test/loader');
const data = require('./fixtures');
const { data } = require('sdk/self');
const { open, focus, close } = require('sdk/window/helpers');
const { open, focus, close } = require('sdk/window/helpers');
const { setTimeout } = require('sdk/timers');
const { setTimeout } = require('sdk/timers');
const { getMostRecentBrowserWindow } = require('sdk/window/utils');
const { getMostRecentBrowserWindow } = require('sdk/window/utils');
+6 −4
Original line number Original line Diff line number Diff line
@@ -444,11 +444,10 @@ pref("browser.tabs.loadDivertedInBackground", false);
pref("browser.tabs.loadBookmarksInBackground", false);
pref("browser.tabs.loadBookmarksInBackground", false);
pref("browser.tabs.tabClipWidth", 140);
pref("browser.tabs.tabClipWidth", 140);
pref("browser.tabs.animate", true);
pref("browser.tabs.animate", true);
pref("browser.tabs.onTop", true);
#ifdef UNIX_BUT_NOT_MAC
#ifdef XP_WIN
pref("browser.tabs.drawInTitlebar", true);
#else
pref("browser.tabs.drawInTitlebar", false);
pref("browser.tabs.drawInTitlebar", false);
#else
pref("browser.tabs.drawInTitlebar", true);
#endif
#endif


// Where to show tab close buttons:
// Where to show tab close buttons:
@@ -1332,3 +1331,6 @@ pref("geo.wifi.uri", "https://www.googleapis.com/geolocation/v1/geolocate?key=%G
// Necko IPC security checks only needed for app isolation for cookies/cache/etc:
// Necko IPC security checks only needed for app isolation for cookies/cache/etc:
// currently irrelevant for desktop e10s
// currently irrelevant for desktop e10s
pref("network.disable.ipc.security", true);
pref("network.disable.ipc.security", true);

// CustomizableUI debug logging.
pref("browser.uiCustomization.debug", false);
+57 −44
Original line number Original line Diff line number Diff line
@@ -178,50 +178,6 @@ const gXPInstallObserver = {
  }
  }
};
};


/*
 * When addons are installed/uninstalled, check and see if the number of items
 * on the add-on bar changed:
 * - If an add-on was installed, incrementing the count, show the bar.
 * - If an add-on was uninstalled, and no more items are left, hide the bar.
 */
let AddonsMgrListener = {
  get addonBar() document.getElementById("addon-bar"),
  get statusBar() document.getElementById("status-bar"),
  getAddonBarItemCount: function() {
    // Take into account the contents of the status bar shim for the count.
    var itemCount = this.statusBar.childNodes.length;

    var defaultOrNoninteractive = this.addonBar.getAttribute("defaultset")
                                      .split(",")
                                      .concat(["separator", "spacer", "spring"]);
    for (let item of this.addonBar.currentSet.split(",")) {
      if (defaultOrNoninteractive.indexOf(item) == -1)
        itemCount++;
    }

    return itemCount;
  },
  onInstalling: function(aAddon) {
    this.lastAddonBarCount = this.getAddonBarItemCount();
  },
  onInstalled: function(aAddon) {
    if (this.getAddonBarItemCount() > this.lastAddonBarCount)
      setToolbarVisibility(this.addonBar, true);
  },
  onUninstalling: function(aAddon) {
    this.lastAddonBarCount = this.getAddonBarItemCount();
  },
  onUninstalled: function(aAddon) {
    if (this.getAddonBarItemCount() == 0)
      setToolbarVisibility(this.addonBar, false);
  },
  onEnabling: function(aAddon) this.onInstalling(),
  onEnabled: function(aAddon) this.onInstalled(),
  onDisabling: function(aAddon) this.onUninstalling(),
  onDisabled: function(aAddon) this.onUninstalled(),
};


var LightWeightThemeWebInstaller = {
var LightWeightThemeWebInstaller = {
  handleEvent: function (event) {
  handleEvent: function (event) {
    switch (event.type) {
    switch (event.type) {
@@ -415,3 +371,60 @@ var LightWeightThemeWebInstaller = {
                                    node.baseURI);
                                    node.baseURI);
  }
  }
}
}

/*
 * Listen for Lightweight Theme styling changes and update the browser's theme accordingly.
 */
let LightweightThemeListener = {
  _modifiedStyles: [],

  init: function () {
    XPCOMUtils.defineLazyGetter(this, "styleSheet", function() {
      for (let i = document.styleSheets.length - 1; i >= 0; i--) {
        let sheet = document.styleSheets[i];
        if (sheet.href == "chrome://browser/skin/browser-lightweightTheme.css")
          return sheet;
      }
    });

    Services.obs.addObserver(this, "lightweight-theme-styling-update", false);
    if (document.documentElement.hasAttribute("lwtheme"))
      this.updateStyleSheet(document.documentElement.style.backgroundImage);
  },

  uninit: function () {
    Services.obs.removeObserver(this, "lightweight-theme-styling-update");
  },

  /**
   * Append the headerImage to the background-image property of all rulesets in
   * browser-lightweightTheme.css.
   *
   * @param headerImage - a string containing a CSS image for the lightweight theme header.
   */
  updateStyleSheet: function(headerImage) {
    if (!this.styleSheet)
      return;
    for (let i = 0; i < this.styleSheet.cssRules.length; i++) {
      let rule = this.styleSheet.cssRules[i];
      if (!rule.style.backgroundImage)
        continue;

      if (!this._modifiedStyles[i])
        this._modifiedStyles[i] = { backgroundImage: rule.style.backgroundImage };

      rule.style.backgroundImage = this._modifiedStyles[i].backgroundImage + ", " + headerImage;
    }
  },

  // nsIObserver
  observe: function (aSubject, aTopic, aData) {
    if (aTopic != "lightweight-theme-styling-update" || !this.styleSheet)
      return;

    let themeData = JSON.parse(aData);
    if (!themeData)
      return;
    this.updateStyleSheet("url(" + themeData.headerURL + ")");
  },
};
Loading