Bug 1407351 - Remove nightly-only e10s testing features from the main browser window. r=mikedeboer

The only thing that I didn't remove was the process ID on the tab tooltip, which I find to be super helpful. For that, I changed the check from E10S_TESTING_ONLY to NIGHTLY_BUILD.

MozReview-Commit-ID: 8wbjdYIC3gb

--HG--
extra : rebase_source : 2ea1b77d4a9fd9c3eb17853c8ec655b309a3fa8c
This commit is contained in:
Felipe Gomes 2017-10-16 14:00:30 -02:00
Родитель aec735d6be
Коммит 4346cedc0e
11 изменённых файлов: 16 добавлений и 111 удалений

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

@ -34,12 +34,6 @@
accesskey="&newPrivateWindow.accesskey;"
command="Tools:PrivateBrowsing"
key="key_privatebrowsing"/>
#ifdef E10S_TESTING_ONLY
<menuitem id="menu_newNonRemoteWindow"
label="&newNonRemoteWindow.label;"
hidden="true"
command="Tools:NonRemoteWindow"/>
#endif
#ifdef MAC_NON_BROWSER_WINDOW
<menuitem id="menu_openLocation"
label="&openLocationCmd.label;"

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

@ -102,10 +102,6 @@
oncommand="Cc['@mozilla.org/browser/browserglue;1'].getService(Ci.nsIBrowserGlue).sanitize(window);"/>
<command id="Tools:PrivateBrowsing"
oncommand="OpenBrowserWindow({private: true});"/>
#ifdef E10S_TESTING_ONLY
<command id="Tools:NonRemoteWindow"
oncommand="OpenBrowserWindow({remote: false});"/>
#endif
<command id="History:UndoCloseTab" oncommand="undoCloseTab();"/>
<command id="History:UndoCloseWindow" oncommand="undoCloseWindow();"/>
</commandset>

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

@ -1466,9 +1466,6 @@ var gBrowserInit = {
IndexedDBPromptHelper.init();
CanvasPermissionPromptHelper.init();
if (AppConstants.E10S_TESTING_ONLY)
gRemoteTabsUI.init();
// Initialize the full zoom setting.
// We do this before the session restore service gets initialized so we can
// apply full zoom settings to tabs restored by the session restore service.
@ -1982,9 +1979,6 @@ if (AppConstants.platform == "macosx") {
// initialize the private browsing UI
gPrivateBrowsingUI.init();
if (AppConstants.E10S_TESTING_ONLY) {
gRemoteTabsUI.init();
}
};
gBrowserInit.nonBrowserWindowShutdown = function() {
@ -8283,27 +8277,6 @@ var gPrivateBrowsingUI = {
}
};
var gRemoteTabsUI = {
init() {
if (window.location.href != getBrowserURL() &&
// Also check hidden window for the Mac no-window case
window.location.href != "chrome://browser/content/hiddenWindow.xul") {
return;
}
if (AppConstants.platform == "macosx" &&
Services.prefs.getBoolPref("layers.acceleration.disabled")) {
// On OS X, "Disable Hardware Acceleration" also disables OMTC and forces
// a fallback to Basic Layers. This is incompatible with e10s.
return;
}
let newNonRemoteWindow = document.getElementById("menu_newNonRemoteWindow");
let autostart = Services.appinfo.browserTabsRemoteAutostart;
newNonRemoteWindow.hidden = !autostart;
}
};
/**
* Switch to a tab that has a given URI, and focuses its browser window.
* If a matching tab is in this window, it will be switched to. Otherwise, other
@ -8561,16 +8534,6 @@ var TabContextMenu = {
if (this.contextTab.hasAttribute("customizemode"))
document.getElementById("context_openTabInWindow").disabled = true;
if (AppConstants.E10S_TESTING_ONLY) {
menuItems = aPopupMenu.getElementsByAttribute("tbattr", "tabbrowser-remote");
for (let menuItem of menuItems) {
menuItem.hidden = !gMultiProcessBrowser;
if (menuItem.id == "context_openNonRemoteWindow") {
menuItem.disabled = !!parseInt(this.contextTab.getAttribute("usercontextid"));
}
}
}
disabled = gBrowser.visibleTabs.length == 1;
menuItems = aPopupMenu.getElementsByAttribute("tbattr", "tabbrowser-multiple-visible");
for (let menuItem of menuItems)

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

@ -96,12 +96,6 @@
accesskey="&moveToNewWindow.accesskey;"
tbattr="tabbrowser-multiple"
oncommand="gBrowser.replaceTabWithWindow(TabContextMenu.contextTab);"/>
#ifdef E10S_TESTING_ONLY
<menuitem id="context_openNonRemoteWindow" label="Open in new non-e10s window"
tbattr="tabbrowser-remote"
hidden="true"
oncommand="gBrowser.openNonRemoteWindow(TabContextMenu.contextTab);"/>
#endif
<menuseparator id="context_sendTabToDevice_separator"/>
<menu id="context_sendTabToDevice" label="&sendTabToDevice.label;"
accesskey="&sendTabToDevice.accesskey;">

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

@ -3954,20 +3954,6 @@
</body>
</method>
<!-- Opens a given tab to a non-remote window. -->
<method name="openNonRemoteWindow">
<parameter name="aTab"/>
<body>
<![CDATA[
if (!AppConstants.E10S_TESTING_ONLY) {
throw "This method is intended only for e10s testing!";
}
let url = aTab.linkedBrowser.currentURI.spec;
return window.openDialog("chrome://browser/content/", "_blank", "chrome,all,dialog=no,non-remote", url);
]]>
</body>
</method>
<method name="moveTabTo">
<parameter name="aTab"/>
<parameter name="aIndex"/>
@ -5544,14 +5530,11 @@
}
} else {
label = tab._fullLabel || tab.getAttribute("label");
if (AppConstants.E10S_TESTING_ONLY &&
if (AppConstants.NIGHTLY_BUILD &&
tab.linkedBrowser &&
tab.linkedBrowser.isRemoteBrowser) {
label += " - e10s";
if (tab.linkedBrowser.frameLoader &&
Services.appinfo.maxWebProcessCount > 1) {
label += " (" + tab.linkedBrowser.frameLoader.tabParent.osPid + ")";
}
tab.linkedBrowser.isRemoteBrowser &&
tab.linkedBrowser.frameLoader) {
label += " (pid " + tab.linkedBrowser.frameLoader.tabParent.osPid + ")";
}
if (tab.userContextId) {
label = this.mStringBundle.getFormattedString("tabs.containers.tooltip", [label, ContextualIdentityService.getUserContextLabel(tab.userContextId)]);

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

@ -59,7 +59,7 @@ const kSubviewEvents = [
* The current version. We can use this to auto-add new default widgets as necessary.
* (would be const but isn't because of testing purposes)
*/
var kVersion = 12;
var kVersion = 13;
/**
* Buttons removed from built-ins by version they were removed. kVersion must be
@ -345,7 +345,6 @@ var CustomizableUIInternal = {
"preferences-button",
"add-ons-button",
"sync-button",
"e10s-button",
];
if (!AppConstants.MOZ_DEV_EDITION) {
@ -452,6 +451,17 @@ var CustomizableUIInternal = {
}
}
}
// Remove the old placements from the now-gone Nightly-only
// "New non-e10s window" button.
if (currentVersion < 13 && gSavedState.placements) {
for (let placements of Object.values(gSavedState.placements)) {
let buttonIndex = placements.indexOf("e10s-button");
if (buttonIndex != -1) {
placements.spice(buttonIndex, 1);
}
}
}
},
/**

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

@ -997,21 +997,3 @@ if (Services.prefs.getBoolPref("privacy.panicButton.enabled")) {
},
});
}
if (AppConstants.E10S_TESTING_ONLY) {
if (Services.appinfo.browserTabsRemoteAutostart) {
CustomizableWidgets.push({
id: "e10s-button",
defaultArea: CustomizableUI.AREA_PANEL,
onBuild(aDocument) {
let node = aDocument.createElementNS(kNSXUL, "toolbarbutton");
node.setAttribute("label", CustomizableUI.getLocalizedProperty(this, "label"));
node.setAttribute("tooltiptext", CustomizableUI.getLocalizedProperty(this, "tooltiptext"));
},
onCommand(aEvent) {
let win = aEvent.view;
win.OpenBrowserWindow({remote: false});
},
});
}
}

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

@ -17,11 +17,6 @@ Services.scriptloader.loadSubScript("chrome://mochikit/content/tests/SimpleTest/
Services.prefs.setBoolPref("browser.uiCustomization.skipSourceNodeCheck", true);
registerCleanupFunction(() => Services.prefs.clearUserPref("browser.uiCustomization.skipSourceNodeCheck"));
// Remove temporary e10s related new window options in customize ui,
// they break a lot of tests.
CustomizableUI.destroyWidget("e10s-button");
CustomizableUI.removeWidgetFromArea("e10s-button");
var {synthesizeDragStart, synthesizeDrop} = EventUtils;
const kNSXUL = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";

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

@ -294,7 +294,6 @@ These should match what Safari and other Apple applications use on OS X Lion. --
<!ENTITY newNavigatorCmd.accesskey "N">
<!ENTITY newPrivateWindow.label "New Private Window">
<!ENTITY newPrivateWindow.accesskey "W">
<!ENTITY newNonRemoteWindow.label "New Non-e10s Window">
<!ENTITY editMenu.label "Edit">
<!ENTITY editMenu.accesskey "E">

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

@ -101,9 +101,6 @@ panic-button.tooltiptext = Forget about some browsing history
devtools-webide-button2.label = WebIDE
devtools-webide-button2.tooltiptext = Open WebIDE (%S)
e10s-button.label = New Non-e10s Window
e10s-button.tooltiptext = Open a new Non-e10s Window
toolbarspring.label = Flexible Space
toolbarseparator.label = Separator
toolbarspacer.label = Space

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

@ -229,14 +229,6 @@ toolbar[brighttext] {
list-style-image: url("chrome://browser/skin/new-window.svg");
}
#e10s-button {
list-style-image: url("chrome://browser/skin/new-window.svg");
}
#e10s-button > .toolbarbutton-icon {
transform: scaleY(-1);
}
#new-tab-button {
list-style-image: url("chrome://browser/skin/new-tab.svg");
}