[Pkg-mozext-commits] [firebug] 20/56: Issue 7686 - introduce e10s notification panel
David Prévot
taffit at moszumanska.debian.org
Wed Nov 19 21:01:43 UTC 2014
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository firebug.
commit 02b7654f3454f5b05f45613c604fe8e928fccf05
Author: Jan Odvarko <odvarko at gmail.com>
Date: Tue Oct 21 11:11:13 2014 +0200
Issue 7686 - introduce e10s notification panel
---
.../content/firebug/firefox/browserOverlay.css | 31 ++++++++
.../content/firebug/firefox/browserOverlay.js | 31 +++++++-
.../firefox/multiprocessNotificationPanel.xml | 87 +++++++++++++++++++++
.../firebug/firefox/start-button/startButton.xml | 25 +++++-
.../en-US/multiprocess-notification.properties | 8 ++
extension/skin/classic/firebug64.png | Bin 0 -> 6373 bytes
6 files changed, 178 insertions(+), 4 deletions(-)
diff --git a/extension/content/firebug/firefox/browserOverlay.css b/extension/content/firebug/firefox/browserOverlay.css
index 73d6361..930af39 100644
--- a/extension/content/firebug/firefox/browserOverlay.css
+++ b/extension/content/firebug/firefox/browserOverlay.css
@@ -192,3 +192,34 @@
.firebugButtonTooltip .panelName.on {
color: black;
}
+
+/*************************************************************************************************/
+/* Start Button - Multiprocess Notification Panel */
+
+fbMultiprocessNotificationPanel {
+ -moz-binding: url("chrome://firebug/content/firefox/multiprocessNotificationPanel.xml#panel");
+}
+
+fbMultiprocessNotificationPanel .iconbox{
+ padding-right: 10px;
+}
+
+fbMultiprocessNotificationPanel .desc {
+ max-width: 300px;
+}
+
+fbMultiprocessNotificationPanel .warn {
+ max-width: 275px;
+}
+
+fbMultiprocessNotificationPanel .warn {
+ color: gray;
+}
+
+fbMultiprocessNotificationPanel .warningbox {
+ margin-top: 15px;
+}
+
+fbMultiprocessNotificationPanel .warningicon {
+ margin-right: 4px;
+}
diff --git a/extension/content/firebug/firefox/browserOverlay.js b/extension/content/firebug/firefox/browserOverlay.js
index 158e938..d046c62 100644
--- a/extension/content/firebug/firefox/browserOverlay.js
+++ b/extension/content/firebug/firefox/browserOverlay.js
@@ -31,6 +31,7 @@ Locale.registerStringBundle("chrome://firebug/locale/selectors.properties");
Locale.registerStringBundle("chrome://firebug/locale/keys.properties");
Locale.registerStringBundle("chrome://global-platform/locale/platformKeys.properties");
Locale.registerStringBundle("chrome://global/locale/keys.properties");
+Locale.registerStringBundle("chrome://firebug/locale/multiprocess-notification.properties");
Cu.import("resource://firebug/loader.js");
Cu.import("resource://firebug/fbtrace.js");
@@ -129,6 +130,13 @@ BrowserOverlay.prototype =
*/
startFirebug: function(callback)
{
+ // Special case for e10s enabled browser.
+ var content = $(this.doc, "content");
+ if (content.mCurrentBrowser.isRemoteBrowser) {
+ this.showMultiprocessNotification();
+ return;
+ }
+
if (this.win.Firebug.waitingForFirstLoad)
return;
@@ -140,8 +148,6 @@ BrowserOverlay.prototype =
this.win.Firebug.waitingForFirstLoad = true;
- var container = $(this.doc, "appcontent");
-
// List of Firebug scripts that must be loaded into the global scope (browser.xul)
// FBTrace is no longer loaded into the global space.
var scriptSources = [
@@ -160,6 +166,8 @@ BrowserOverlay.prototype =
// $script(self.doc, url);
});
+ var container = $(this.doc, "appcontent");
+
// Create Firebug splitter element.
$el(this.doc, "splitter", {id: "fbContentSplitter", collapsed: "true"}, container);
@@ -582,7 +590,24 @@ BrowserOverlay.prototype =
"nsIVersionComparator");
return versionChecker.compare(version, currentVersion);
- }
+ },
+
+ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+ // Remote Browser (aka e10s enabled browser)
+
+ showMultiprocessNotification: function()
+ {
+ var popupSet = $(this.doc, "mainPopupSet");
+ var panel = this.doc.querySelector("fbMultiprocessNotificationPanel");
+ if (!panel)
+ {
+ panel = this.doc.createElement("fbMultiprocessNotificationPanel");
+ popupSet.appendChild(panel);
+ }
+
+ panel.internationalize(Locale);
+ panel.open();
+ },
};
// ********************************************************************************************* //
diff --git a/extension/content/firebug/firefox/multiprocessNotificationPanel.xml b/extension/content/firebug/firefox/multiprocessNotificationPanel.xml
new file mode 100644
index 0000000..b414a89
--- /dev/null
+++ b/extension/content/firebug/firefox/multiprocessNotificationPanel.xml
@@ -0,0 +1,87 @@
+<?xml version="1.0"?>
+<!-- See license.txt for terms of usage -->
+
+<bindings xmlns="http://www.mozilla.org/xbl"
+ xmlns:xbl="http://www.mozilla.org/xbl"
+ xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+ xmlns:html="http://www.w3.org/1999/xhtml">
+
+<binding id="panel">
+ <resources>
+ <stylesheet src="chrome://global/skin/notification.css"/>
+ </resources>
+ <content>
+ <xul:panel anonid="panel" norestorefocus="true" noautofocus="true"
+ ignorekeys="true" role="presentation" type="arrow" noautohide="true" class="panel">
+ <xul:hbox>
+ <xul:vbox class="iconbox">
+ <xul:image src="chrome://firebug/skin/firebug64.png"/>
+ </xul:vbox>
+ <xul:vbox>
+ <xul:description anonid="desc" class="desc" />
+ <xul:hbox class="warningbox">
+ <xul:vbox>
+ <xul:spacer flex="1"/>
+ <xul:image src="chrome://firebug/skin/warning.svg" class="warningicon"/>
+ <xul:spacer flex="1"/>
+ </xul:vbox>
+ <xul:vbox>
+ <xul:description anonid="warning" class="warn" />
+ </xul:vbox>
+ </xul:hbox>
+ <xul:label anonid="learnMore"
+ class="text-link popup-notification-learnmore-link learnMore"
+ href="https://getfirebug.com/"/>
+ <xul:hbox align="right">
+ <xul:button anonid="upgrade" type="menu-button"
+ class="popup-notification-menubutton">
+ <xul:menupopup>
+ <xul:menuitem anonid="disable"/>
+ </xul:menupopup>
+ </xul:button>
+ </xul:hbox>
+
+ </xul:vbox>
+ </xul:hbox>
+ </xul:panel>
+ </content>
+
+ <implementation>
+ <constructor><![CDATA[
+ ]]></constructor>
+
+ <method name="internationalize">
+ <parameter name="Locale" />
+ <body><![CDATA[
+ var desc = document.getAnonymousElementByAttribute(this, "anonid", "desc");
+ desc.textContent = Locale.$STR("multiprocess.description");
+
+ var warn = document.getAnonymousElementByAttribute(this, "anonid", "warning");
+ warn.textContent = Locale.$STR("multiprocess.warning");
+
+ var learnMore = document.getAnonymousElementByAttribute(this, "anonid", "learnMore");
+ learnMore.textContent = Locale.$STR("multiprocess.learnMore");
+
+ var upgradeButton = document.getAnonymousElementByAttribute(this, "anonid", "upgrade");
+ upgradeButton.label = Locale.$STR("multiprocess.upgrade");
+
+ var disableMenu = document.getAnonymousElementByAttribute(this, "anonid", "disable");
+ disableMenu.label = Locale.$STR("multiprocess.disable");
+ ]]></body>
+ </method>
+
+ <method name="open">
+ <body><![CDATA[
+ var panel = document.getAnonymousElementByAttribute(this, "anonid", "panel");
+ var startButton = document.getElementById("firebug-button");
+ var style = document.defaultView.getComputedStyle(startButton.button);
+ var offsetY = parseInt(style["padding-bottom"]);
+ var offsetX = parseInt(style["width"])/2;
+ panel.openPopup(startButton.button, "after_end", -offsetX, -offsetY, false, false);
+ ]]></body>
+ </method>
+ </implementation>
+
+</binding>
+
+</bindings>
diff --git a/extension/content/firebug/firefox/start-button/startButton.xml b/extension/content/firebug/firefox/start-button/startButton.xml
index d35ec19..237a09f 100644
--- a/extension/content/firebug/firefox/start-button/startButton.xml
+++ b/extension/content/firebug/firefox/start-button/startButton.xml
@@ -15,9 +15,32 @@
anonid="button" flex="1" allowevents="true"
xbl:inherits="disabled,crop,image,label,accesskey,command,align,dir,pack,orient"/>
<xul:dropmarker type="menu-button" class="toolbarbutton-menubutton-dropmarker"
- xbl:inherits="align,dir,pack,orient,disabled,label"/>
+ anonid="dropmarker" xbl:inherits="align,dir,pack,orient,disabled,label"/>
</content>
+ <implementation>
+ <constructor><![CDATA[
+ var content = document.getElementById("content");
+ if (content.mCurrentBrowser.isRemoteBrowser)
+ {
+ this.setAttribute("type", "button");
+ this.button.classList.remove("toolbarbutton-menubutton-button");
+ this.button.classList.add("toolbarbutton-1");
+ this.button.classList.add("chromeclass-toolbar-additional");
+
+ var dropMarker = document.getAnonymousElementByAttribute(this,
+ "anonid", "dropmarker");
+ dropMarker.setAttribute("collapsed", "true");
+ }
+ ]]></constructor>
+
+ <property name="button">
+ <xbl:getter><![CDATA[
+ return document.getAnonymousElementByAttribute(this, "anonid", "button");
+ ]]></xbl:getter>
+ </property>
+ </implementation>
+
</binding>
</bindings>
diff --git a/extension/locale/en-US/multiprocess-notification.properties b/extension/locale/en-US/multiprocess-notification.properties
new file mode 100644
index 0000000..a02a8b3
--- /dev/null
+++ b/extension/locale/en-US/multiprocess-notification.properties
@@ -0,0 +1,8 @@
+# LOCALIZATION NOTE (multiprocess.description, multiprocess.learnMore, multiprocess.warning):
+# Label used in a notification panel that is displayed when the user clicks on Firebug start
+# button in multiprocess Firefox browser (e10s enabled browser).
+multiprocess.description=You are running Firebug 2 in multiprocess Firefox browser (e10s). In order to continue using this browser you need to upgrade to Firebug 3.
+multiprocess.learnMore=Learn more...
+multiprocess.warning=You might want to disable multiprocess feature on this browser in order to continue using Firebug 2, but you will be at a significant performance, stability, and security disadvantage.
+multiprocess.upgrade=Upgrade and Restart
+multiprocess.disable=Disable e10s
\ No newline at end of file
diff --git a/extension/skin/classic/firebug64.png b/extension/skin/classic/firebug64.png
new file mode 100644
index 0000000..1402559
Binary files /dev/null and b/extension/skin/classic/firebug64.png differ
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/firebug.git
More information about the Pkg-mozext-commits
mailing list