Skip to content

Commit

Permalink
Merge mozilla-central and ux
Browse files Browse the repository at this point in the history
  • Loading branch information
gijsk committed Nov 6, 2013
2 parents e4c6626 + 3c261f1 commit 4aac31b
Show file tree
Hide file tree
Showing 291 changed files with 15,129 additions and 5,706 deletions.
2 changes: 1 addition & 1 deletion accessible/tests/mochitest/events/test_focus_general.html
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
gQueue.push(new focusElmWhileSubdocIsFocused("link"));

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,
// other platforms requires setting a ui.key.menuAccessKeyFocuses
// preference.
Expand Down
2 changes: 1 addition & 1 deletion accessible/tests/mochitest/events/test_menu.xul
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@
// Alt key is used to active menubar and focus menu item on Windows,
// other platforms requires setting a ui.key.menuAccessKeyFocuses
// preference.
if (WIN) {
if (WIN || LINUX) {
gQueue.push(new focusFileMenu());
gQueue.push(new focusEditMenu());
gQueue.push(new leaveMenubar());
Expand Down
10 changes: 6 additions & 4 deletions browser/app/profile/firefox.js
Original file line number Diff line number Diff line change
Expand Up @@ -444,11 +444,10 @@ pref("browser.tabs.loadDivertedInBackground", false);
pref("browser.tabs.loadBookmarksInBackground", false);
pref("browser.tabs.tabClipWidth", 140);
pref("browser.tabs.animate", true);
pref("browser.tabs.onTop", true);
#ifdef XP_WIN
pref("browser.tabs.drawInTitlebar", true);
#else
#ifdef UNIX_BUT_NOT_MAC
pref("browser.tabs.drawInTitlebar", false);
#else
pref("browser.tabs.drawInTitlebar", true);
#endif

// Where to show tab close buttons:
Expand Down Expand Up @@ -1322,3 +1321,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:
// currently irrelevant for desktop e10s
pref("network.disable.ipc.security", true);

// CustomizableUI debug logging.
pref("browser.uiCustomization.debug", false);
101 changes: 57 additions & 44 deletions browser/base/content/browser-addons.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
handleEvent: function (event) {
switch (event.type) {
Expand Down Expand Up @@ -415,3 +371,60 @@ var LightWeightThemeWebInstaller = {
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

0 comments on commit 4aac31b

Please sign in to comment.