Skip to content

Commit

Permalink
merge fx-team to mozilla-central a=merge
Browse files Browse the repository at this point in the history
  • Loading branch information
BavarianTomcat committed Nov 4, 2014
2 parents 5e86aa7 + a927772 commit f8e30aa
Show file tree
Hide file tree
Showing 37 changed files with 1,014 additions and 329 deletions.
3 changes: 3 additions & 0 deletions browser/app/profile/firefox.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,9 @@ pref("app.update.metro.enabled", true);
// If set to true, the Update Service will present no UI for any event.
pref("app.update.silent", false);

// If set to true, the hamburger button will show badges for update events.
pref("app.update.badge", false);

// If set to true, the Update Service will apply updates in the background
// when it finishes downloading them.
pref("app.update.staging.enabled", true);
Expand Down
116 changes: 116 additions & 0 deletions browser/base/content/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -1324,6 +1324,8 @@ var gBrowserInit = {
// Add Devtools menuitems and listeners
gDevToolsBrowser.registerBrowserWindow(window);

gMenuButtonUpdateBadge.init();

window.addEventListener("mousemove", MousePosTracker, false);
window.addEventListener("dragover", MousePosTracker, false);

Expand Down Expand Up @@ -1470,6 +1472,8 @@ var gBrowserInit = {

DevEdition.uninit();

gMenuButtonUpdateBadge.uninit();

var enumerator = Services.wm.getEnumerator(null);
enumerator.getNext();
if (!enumerator.hasMoreElements()) {
Expand Down Expand Up @@ -2439,6 +2443,118 @@ function PageProxyClickHandler(aEvent)
middleMousePaste(aEvent);
}

// Setup the hamburger button badges for updates, if enabled.
let gMenuButtonUpdateBadge = {
enabled: false,

init: function () {
try {
this.enabled = Services.prefs.getBoolPref("app.update.badge");
} catch (e) {}
if (this.enabled) {
PanelUI.menuButton.classList.add("badged-button");
Services.obs.addObserver(this, "update-staged", false);
}
},

uninit: function () {
if (this.enabled) {
Services.obs.removeObserver(this, "update-staged");
PanelUI.panel.removeEventListener("popupshowing", this, true);
this.enabled = false;
}
},

onMenuPanelCommand: function(event) {
if (event.originalTarget.getAttribute("update-status") === "succeeded") {
// restart the app
let cancelQuit = Cc["@mozilla.org/supports-PRBool;1"]
.createInstance(Ci.nsISupportsPRBool);
Services.obs.notifyObservers(cancelQuit, "quit-application-requested", "restart");

if (!cancelQuit.data) {
Services.startup.quit(Services.startup.eAttemptQuit | Services.startup.eRestart);
}
} else {
// open the page for manual update
let url = Services.urlFormatter.formatURLPref("app.update.url.manual");
openUILinkIn(url, "tab");
}
},

observe: function (subject, topic, status) {
const STATE_DOWNLOADING = "downloading";
const STATE_PENDING = "pending";
const STATE_PENDING_SVC = "pending-service";
const STATE_APPLIED = "applied";
const STATE_APPLIED_SVC = "applied-service";
const STATE_FAILED = "failed";

let updateButton = document.getElementById("PanelUI-update-status");

let updateButtonText;
let stringId;

// Update the UI when the background updater is finished.
switch (status) {
case STATE_APPLIED:
case STATE_APPLIED_SVC:
case STATE_PENDING:
case STATE_PENDING_SVC:
// If the update is successfully applied, or if the updater has fallen back
// to non-staged updates, add a badge to the hamburger menu to indicate an
// update will be applied once the browser restarts.
let badge = document.getAnonymousElementByAttribute(PanelUI.menuButton,
"class",
"toolbarbutton-badge");
badge.style.backgroundColor = 'green';
PanelUI.menuButton.setAttribute("badge", "\u2605");

let brandBundle = document.getElementById("bundle_brand");
let brandShortName = brandBundle.getString("brandShortName");
stringId = "appmenu.restartNeeded.description";
updateButtonText = gNavigatorBundle.getFormattedString(stringId,
[brandShortName]);

updateButton.label = updateButtonText;
updateButton.hidden = false;
updateButton.setAttribute("update-status", "succeeded");

PanelUI.panel.addEventListener("popupshowing", this, true);

break;
case STATE_FAILED:
// Background update has failed, let's show the UI responsible for
// prompting the user to update manually.
PanelUI.menuButton.setAttribute("badge", "!");

stringId = "appmenu.updateFailed.description";
updateButtonText = gNavigatorBundle.getString(stringId);

updateButton.label = updateButtonText;
updateButton.hidden = false;
updateButton.setAttribute("update-status", "failed");

PanelUI.panel.addEventListener("popupshowing", this, true);

break;
case STATE_DOWNLOADING:
// We've fallen back to downloading the full update because the partial
// update failed to get staged in the background. Therefore we need to keep
// our observer.
return;
}
this.uninit();
},

handleEvent: function(e) {
if (e.type === "popupshowing") {
PanelUI.menuButton.removeAttribute("badge");
PanelUI.panel.removeEventListener("popupshowing", this, true);
}
}
};

/**
* Handle command events bubbling up from error page content
* or from about:newtab or from remote error pages that invoke
Expand Down
3 changes: 1 addition & 2 deletions browser/base/content/newtab/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,12 +213,11 @@ let gSearch = {

if (uri) {
this._nodes.logo.style.backgroundImage = "url(" + uri + ")";
this._nodes.text.placeholder = "";
}
else {
this._nodes.logo.style.backgroundImage = "";
this._nodes.text.placeholder = engine.name;
}
this._nodes.text.placeholder = engine.placeholder;

// Set up the suggestion controller.
if (!this._suggestionController) {
Expand Down
30 changes: 13 additions & 17 deletions browser/base/content/test/general/browser.ini
Original file line number Diff line number Diff line change
Expand Up @@ -140,19 +140,19 @@ skip-if = e10s
[browser_bug356571.js]
[browser_bug380960.js]
[browser_bug386835.js]
skip-if = e10s # Bug 691614 - no e10s zoom support yet
skip-if = e10s # Bug 1056146 - zoom tests use FullZoomHelper and break in e10s
[browser_bug405137.js]
[browser_bug406216.js]
[browser_bug409481.js]
[browser_bug409624.js]
skip-if = e10s
[browser_bug413915.js]
[browser_bug416661.js]
skip-if = e10s # Bug 691614 - no e10s zoom support yet
skip-if = e10s # Bug 1056146 - zoom tests use FullZoomHelper and break in e10s
[browser_bug417483.js]
skip-if = e10s # Bug 1093155 - tries to use context menu from browser-chrome and gets in a mess when in e10s mode
[browser_bug419612.js]
skip-if = e10s # Bug 691614 - no e10s zoom support yet
skip-if = e10s # Bug 1056146 - zoom tests use FullZoomHelper and break in e10s
[browser_bug422590.js]
[browser_bug846489.js]
[browser_bug423833.js]
Expand All @@ -168,19 +168,19 @@ skip-if = e10s # Bug ?????? - test directly manipulates content (eg, var expertD
[browser_bug435325.js]
skip-if = buildapp == 'mulet' || e10s # Bug ?????? - test directly manipulates content
[browser_bug441778.js]
skip-if = buildapp == 'mulet' || e10s # Bug 691614 - no e10s zoom support yet
skip-if = buildapp == 'mulet' || e10s # Bug 1056146 - zoom tests use FullZoomHelper and break in e10s
[browser_bug455852.js]
skip-if = e10s
[browser_bug460146.js]
skip-if = e10s # Bug 866413 - PageInfo doesn't work in e10s
[browser_bug462289.js]
skip-if = toolkit == "cocoa" || e10s # Bug ?????? - not sure why this is timing out and crashing!!
[browser_bug462673.js]
skip-if = e10s # Bug 924260 - "Window is closed"
skip-if = e10s # Bug 1093404 - test expects sync window opening from content and is disappointed in that expectation
[browser_bug477014.js]
skip-if = e10s # Bug 1093206 - need to re-enable tests relying on swapFrameLoaders et al for e10s
[browser_bug479408.js]
skip-if = buildapp == 'mulet' || e10s # Bug 918663 - DOMLinkAdded events don't make their way to chrome
skip-if = buildapp == 'mulet'
[browser_bug481560.js]
skip-if = e10s # Bug ????? - This bug attached an event listener directly to the content
[browser_bug484315.js]
Expand All @@ -195,23 +195,20 @@ skip-if = e10s # Bug 866413 - PageInfo doesn't work in e10s
skip-if = e10s # Bug ?????? - some weird timing issue with progress listeners that fails intermittently
[browser_bug520538.js]
[browser_bug521216.js]
skip-if = e10s # Bug 918663 - DOMLinkAdded events don't make their way to chrome
[browser_bug533232.js]
[browser_bug537013.js]
skip-if = buildapp == 'mulet' || e10s # Bug 1093206 - need to re-enable tests relying on swapFrameLoaders et al for e10s (test calls replaceTabWithWindow)
[browser_bug537474.js]
skip-if = e10s # Bug ?????? - test doesn't wait for document to be created before it checks it
[browser_bug550565.js]
skip-if = e10s # Bug 918663 - DOMLinkAdded events don't make their way to chrome (which is how gBrowser.getIcon works)
[browser_bug553455.js]
skip-if = buildapp == 'mulet' || e10s # Bug 1066070 - I don't think either popup notifications nor addon install stuff works?
[browser_bug555224.js]
skip-if = e10s # Bug 691614 - no e10s zoom support yet
skip-if = e10s # Bug 1056146 - zoom tests use FullZoomHelper and break in e10s
[browser_bug555767.js]
skip-if = e10s # Bug 916974 - Session history doesn't work in e10s
skip-if = e10s # Bug 1093373 - relies on browser.sessionHistory
[browser_bug556061.js]
[browser_bug559991.js]
skip-if = e10s # Bug 691614 - no e10s zoom support yet
[browser_bug561623.js]
skip-if = e10s
[browser_bug561636.js]
Expand All @@ -227,7 +224,7 @@ run-if = toolkit == "cocoa"
skip-if = e10s
[browser_bug575561.js]
[browser_bug575830.js]
skip-if = e10s # Bug 691614 - no e10s zoom support yet
skip-if = e10s # Bug 1056146 - zoom tests use FullZoomHelper and break in e10s
[browser_bug577121.js]
[browser_bug578534.js]
skip-if = e10s # Bug ?????? - test directly manipulates content
Expand Down Expand Up @@ -260,7 +257,7 @@ skip-if = e10s # Bug ?????? - URLBar issues (apparently issues with redirection)
[browser_bug633691.js]
skip-if = e10s # Bug ?????? - test directly manipulates content (eg, var expertDiv = gBrowser.contentDocument.getElementById("expertContent");)
[browser_bug647886.js]
skip-if = buildapp == 'mulet' || e10s # Bug 916974 - Session history doesn't work in e10s
skip-if = buildapp == 'mulet' || e10s # Bug 1093373 - Relies on browser.sessionHistory
[browser_bug655584.js]
skip-if = e10s
[browser_bug664672.js]
Expand All @@ -271,7 +268,7 @@ skip-if = e10s # Bug ?????? - Obscure non-windows failures ("Snapshot array has
[browser_bug710878.js]
skip-if = e10s # Bug ?????? - test directly manipulates content (doc.querySelector)
[browser_bug719271.js]
skip-if = e10s # Bug 691614 - no e10s zoom support yet
skip-if = e10s # Bug 1056146 - zoom tests use FullZoomHelper and break in e10s
[browser_bug724239.js]
skip-if = e10s # Bug 1077738
[browser_bug734076.js]
Expand All @@ -287,7 +284,7 @@ skip-if = e10s # Bug ?????? - test reports a leaked nsGlobalWindow with e10s ena
skip-if = e10s # Bug ?????? - test directly manipulates content
[browser_bug783614.js]
[browser_bug816527.js]
skip-if = e10s # Bug 916974 - Session history doesn't work in e10s
skip-if = e10s # Bug 1093373 - relies on browser.sessionHistory
[browser_bug817947.js]
[browser_bug822367.js]
[browser_bug832435.js]
Expand All @@ -301,7 +298,7 @@ skip-if = buildapp == "mulet" || e10s # Bug ?????? - test directly manipulates c
[browser_bug970746.js]
skip-if = e10s # Bug ?????? - test directly manipulates content (directly gets elements from the content)
[browser_bug1015721.js]
skip-if = os == 'win' || e10s # Bug 1056146 - FullZoomHelper uses promiseTabLoadEvent() which isn't e10s friendly
skip-if = os == 'win' || e10s # Bug 1056146 - zoom tests use FullZoomHelper and break in e10s
[browser_bug1064280_changeUrlInPinnedTab.js]
[browser_canonizeURL.js]
skip-if = e10s # Bug ?????? - [JavaScript Error: "Error in AboutHome.sendAboutHomeData TypeError: target.messageManager is undefined" {file: "resource:///modules/AboutHome.jsm" line: 208}]
Expand All @@ -321,7 +318,6 @@ skip-if = buildapp == 'mulet' || (os == "linux" && debug) || e10s # linux: bug 9
[browser_devices_get_user_media_about_urls.js]
skip-if = e10s # Bug 1071623
[browser_discovery.js]
skip-if = e10s # Bug 918663 - DOMLinkAdded events don't make their way to chrome
[browser_double_close_tab.js]
skip-if = e10s
[browser_duplicateIDs.js]
Expand Down
4 changes: 4 additions & 0 deletions browser/components/customizableui/content/panelUI.inc.xul
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
</vbox>

<footer id="PanelUI-footer">
<toolbarbutton id="PanelUI-update-status"
oncommand="gMenuButtonUpdateBadge.onMenuPanelCommand(event);"
wrap="true"
hidden="true"/>
<toolbarbutton id="PanelUI-fxa-status"
defaultlabel="&fxaSignIn.label;"
errorlabel="&fxaSignInError.label;"
Expand Down
1 change: 1 addition & 0 deletions browser/components/loop/standalone/content/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
window.OTProperties.configURL = window.OTProperties.assetURL + 'js/dynamic_config.min.js';
window.OTProperties.cssURL = window.OTProperties.assetURL + 'css/ot.css';
</script>
<script type="text/javascript" src="js/multiplexGum.js"></script>
<script type="text/javascript" src="shared/libs/sdk.js"></script>
<script type="text/javascript" src="libs/l10n-gaia-02ca67948fe8.js"></script>
<script type="text/javascript" src="shared/libs/react-0.11.2.js"></script>
Expand Down
Loading

0 comments on commit f8e30aa

Please sign in to comment.