Bug 997446 - Add temporary "Open e10s Window" icon to menu panel default set. Will only be available if browser.tabs.remote is true. r=jaws.

This commit is contained in:
Mike Conley 2014-04-25 16:08:31 -04:00
Родитель e66a7d624b
Коммит 1f6b121ffb
6 изменённых файлов: 77 добавлений и 1 удалений

Просмотреть файл

@ -165,6 +165,15 @@ let CustomizableUIInternal = {
panelPlacements.push("switch-to-metro-button");
}
#ifdef NIGHTLY_BUILD
if (gPalette.has("e10s-button")) {
let newWindowIndex = panelPlacements.indexOf("new-window-button");
if (newWindowIndex > -1) {
panelPlacements.splice(newWindowIndex + 1, 0, "e10s-button");
}
}
#endif
let showCharacterEncoding = Services.prefs.getComplexValue(
"browser.menu.showCharacterEncoding",
Ci.nsIPrefLocalizedString

Просмотреть файл

@ -912,3 +912,36 @@ if (Services.metro && Services.metro.supported) {
}
#endif
#endif
#ifdef NIGHTLY_BUILD
/**
* The e10s button's purpose is to lower the barrier of entry
* for our Nightly testers to use e10s windows. We'll be removing it
* once remote tabs are enabled. This button should never ever make it
* to production. If it does, that'd be bad, and we should all feel bad.
*/
if (Services.prefs.getBoolPref("browser.tabs.remote")) {
let getCommandFunction = function(aOpenRemote) {
return function(aEvent) {
let win = aEvent.view;
if (win && typeof win.OpenBrowserWindow == "function") {
win.OpenBrowserWindow({remote: aOpenRemote});
}
};
}
let openRemote = !Services.prefs.getBoolPref("browser.tabs.remote.autostart");
// Like the XUL menuitem counterparts, we hard-code these strings in because
// this button should never roll into production.
let buttonLabel = openRemote ? "New e10s Window"
: "New Non-e10s Window";
CustomizableWidgets.push({
id: "e10s-button",
label: buttonLabel,
tooltiptext: buttonLabel,
defaultArea: CustomizableUI.AREA_PANEL,
onCommand: getCommandFunction(openRemote),
});
}
#endif

Просмотреть файл

@ -701,6 +701,10 @@ toolbar .toolbarbutton-1 > .toolbarbutton-menubutton-dropmarker > .dropmarker-ic
-moz-image-region: rect(18px, 342px, 36px, 324px);
}
#e10s-button@toolbarButtonPressed@ {
-moz-image-region: rect(18px, 342px, 36px, 324px);
}
#new-tab-button@toolbarButtonPressed@ {
-moz-image-region: rect(18px, 360px, 36px, 342px);
}
@ -942,6 +946,18 @@ toolbar .toolbarbutton-1 > .toolbarbutton-menubutton-dropmarker > .dropmarker-ic
-moz-image-region: rect(36px, 684px, 72px, 648px);
}
#e10s-button[cui-areatype="toolbar"] {
-moz-image-region: rect(0, 684px, 36px, 648px);
}
#e10s-button[cui-areatype="toolbar"]:hover:active:not([disabled="true"]) {
-moz-image-region: rect(36px, 684px, 72px, 648px);
}
#e10s-button > .toolbarbutton-icon {
transform: scaleY(-1);
}
#new-tab-button[cui-areatype="toolbar"] {
-moz-image-region: rect(0, 720px, 36px, 684px);
}
@ -1190,6 +1206,11 @@ toolbar .toolbarbutton-1 > .toolbarbutton-menubutton-dropmarker > .dropmarker-ic
-moz-image-region: rect(0px, 1024px, 64px, 960px);
}
#e10s-button[cui-areatype="menu-panel"],
toolbarpaletteitem[place="palette"] > #e10s-button {
-moz-image-region: rect(0px, 1024px, 64px, 960px);
}
#new-tab-button[cui-areatype="menu-panel"],
toolbarpaletteitem[place="palette"] > #new-tab-button {
-moz-image-region: rect(0px, 1088px, 64px, 1024px);

Просмотреть файл

@ -2,7 +2,7 @@
% Note that zoom-reset-button is a bit different since it doesn't use an image and thus has the image with display: none.
%define nestedButtons #zoom-out-button, #zoom-reset-button, #zoom-in-button, #cut-button, #copy-button, #paste-button
%define primaryToolbarButtons #back-button, #forward-button, #home-button, #print-button, #downloads-button, #bookmarks-menu-button, #new-tab-button, #new-window-button, #fullscreen-button, #sync-button, #feed-button, #tabview-button, #webrtc-status-button, #social-share-button, #open-file-button, #find-button, #developer-button, #preferences-button, #privatebrowsing-button, #save-page-button, #switch-to-metro-button, #add-ons-button, #history-panelmenu, #nav-bar-overflow-button, #PanelUI-menu-button, #characterencoding-button, #email-link-button, #sidebar-button, @nestedButtons@
%define primaryToolbarButtons #back-button, #forward-button, #home-button, #print-button, #downloads-button, #bookmarks-menu-button, #new-tab-button, #new-window-button, #fullscreen-button, #sync-button, #feed-button, #tabview-button, #webrtc-status-button, #social-share-button, #open-file-button, #find-button, #developer-button, #preferences-button, #privatebrowsing-button, #save-page-button, #switch-to-metro-button, #add-ons-button, #history-panelmenu, #nav-bar-overflow-button, #PanelUI-menu-button, #characterencoding-button, #email-link-button, #sidebar-button, @nestedButtons@, #e10s-button
%ifdef XP_MACOSX
% Prior to 10.7 there wasn't a native fullscreen button so we use #restore-button to exit fullscreen

Просмотреть файл

@ -83,6 +83,11 @@ toolbarpaletteitem[place="palette"] > #new-window-button {
-moz-image-region: rect(0px, 512px, 32px, 480px);
}
#e10s-button[cui-areatype="menu-panel"],
toolbarpaletteitem[place="palette"] > #e10s-button {
-moz-image-region: rect(0px, 512px, 32px, 480px);
}
#new-tab-button[cui-areatype="menu-panel"],
toolbarpaletteitem[place="palette"] > #new-tab-button {
-moz-image-region: rect(0px, 544px, 32px, 512px);

Просмотреть файл

@ -85,6 +85,14 @@
-moz-image-region: rect(0, 342px, 18px, 324px);
}
#e10s-button[cui-areatype="toolbar"] {
-moz-image-region: rect(0, 342px, 18px, 324px);
}
#e10s-button > .toolbarbutton-icon {
transform: scaleY(-1);
}
#new-tab-button[cui-areatype="toolbar"] {
-moz-image-region: rect(0, 360px, 18px, 342px);
}