Skip to content

Commit

Permalink
Bug 1711519 - remove trivial gProton and gProtonDoorhangers checks, r…
Browse files Browse the repository at this point in the history
…=jaws

Differential Revision: https://phabricator.services.mozilla.com/D116630
  • Loading branch information
gijsk committed Jun 3, 2021
1 parent a5de5d2 commit a9281ae
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 112 deletions.
6 changes: 0 additions & 6 deletions browser/base/content/browser-allTabsMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,6 @@ var gTabsPanel = {
showAllTabsPanel(event) {
this.init();
if (this.canOpen) {
if (!gProton) {
PanelMultiView.getViewNode(
document,
"allTabsMenu-searchTabs"
).classList.add("subviewbutton-iconic");
}
PanelUI.showSubView(
this.kElements.allTabsView,
this.allTabsButton,
Expand Down
13 changes: 5 additions & 8 deletions browser/base/content/browser-pageActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -623,15 +623,15 @@ var BrowserPageActions = {
urlbarNode,
disabled = action.getDisabled(window)
) {
// When Proton is enabled, the extension page actions should behave similarly
// to a transient action, and be hidden from the urlbar overflow menu if they
// Extension page actions should behave like a transient action,
// and be hidden from the urlbar overflow menu if they
// are disabled (as in the urlbar when the overflow menu isn't available)
//
// TODO(Bug 1704139): as a follow up we may look into just set on all
// extension pageActions `_transient: true`, at least once we sunset
// the proton preference and we don't need the pre-Proton behavior anymore,
// and remove this special case.
const isProtonExtensionAction = action.extensionID && gProton;
const isProtonExtensionAction = action.extensionID;

if (action.__transient || isProtonExtensionAction) {
this.placeActionInPanel(action);
Expand Down Expand Up @@ -942,11 +942,8 @@ var BrowserPageActions = {
}

let action = this.actionForNode(popup.triggerNode);
if (
!action ||
// In Proton, only extension actions provide a context menu.
(gProton && !action.extensionID)
) {
// Only extension actions provide a context menu.
if (!action?.extensionID) {
this._contextAction = null;
event.preventDefault();
return;
Expand Down
4 changes: 0 additions & 4 deletions browser/base/content/browser-places.js
Original file line number Diff line number Diff line change
Expand Up @@ -1687,10 +1687,6 @@ var BookmarkingUI = {
entry: "subviewbutton",
};

if (!gProtonDoorhangers) {
extraClasses.footer = "panel-subview-footer";
}

new PlacesMenu(event, `place:parent=${PlacesUtils.bookmarks.menuGuid}`, {
extraClasses,
insertionPoint: ".panel-subview-footer-button",
Expand Down
16 changes: 3 additions & 13 deletions browser/base/content/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -573,14 +573,6 @@ XPCOMUtils.defineLazyPreferenceGetter(
false
);

/* Temporary pref while the Proton doorhangers work stablizes. */
XPCOMUtils.defineLazyPreferenceGetter(
this,
"gProtonDoorhangers",
"browser.proton.doorhangers.enabled",
false
);

customElements.setElementCreationCallback("translation-notification", () => {
Services.scriptloader.loadSubScript(
"chrome://browser/content/translation-notification.js",
Expand Down Expand Up @@ -7540,7 +7532,7 @@ var IndexedDBPromptHelper = {
Ci.nsIPermissionManager.ALLOW_ACTION
);
},
disableHighlight: gProtonDoorhangers,
disableHighlight: true,
};

var secondaryActions = [
Expand Down Expand Up @@ -7639,7 +7631,7 @@ var CanvasPermissionPromptHelper = {
state && state.checkboxChecked
);
},
disableHighlight: gProtonDoorhangers,
disableHighlight: true,
};

let secondaryActions = [
Expand Down Expand Up @@ -7813,9 +7805,7 @@ var WebAuthnPromptHelper = {
}
};

if (gProtonDoorhangers) {
mainAction.disableHighlight = true;
}
mainAction.disableHighlight = true;

this._tid = tid;
this._current = PopupNotifications.show(
Expand Down
7 changes: 2 additions & 5 deletions browser/base/content/tabbrowser.js
Original file line number Diff line number Diff line change
Expand Up @@ -7172,11 +7172,8 @@ var TabContextMenu = {
updateShareURLMenuItem() {
// We only support "share URL" on macOS and on Windows 10:
if (
!gProton ||
!(
AppConstants.platform == "macosx" ||
AppConstants.isPlatformAndVersionAtLeast("win", "6.4")
)
AppConstants.platform != "macosx" &&
!AppConstants.isPlatformAndVersionAtLeast("win", "6.4")
) {
return;
}
Expand Down
23 changes: 0 additions & 23 deletions browser/components/customizableui/CustomizeMode.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,6 @@ XPCOMUtils.defineLazyGetter(this, "gWidgetsBundle", function() {
"chrome://browser/locale/customizableui/customizableWidgets.properties";
return Services.strings.createBundle(kUrl);
});
XPCOMUtils.defineLazyPreferenceGetter(
this,
"gProton",
"browser.proton.enabled",
false
);
XPCOMUtils.defineLazyServiceGetter(
this,
"gTouchBarUpdater",
Expand Down Expand Up @@ -255,21 +249,6 @@ CustomizeMode.prototype = {
}
},

async _updateThemeButtonIcon() {
// Keep the default button icon.
if (gProton) {
return;
}

let lwthemeButton = this.$("customization-lwtheme-button");
let lwthemeIcon = lwthemeButton.icon;
let theme = (await AddonManager.getAddonsByTypes(["theme"])).find(
addon => addon.isActive
);
lwthemeIcon.style.backgroundImage =
theme && theme.iconURL ? "url(" + theme.iconURL + ")" : "";
},

setTab(aTab) {
if (gTab == aTab) {
return;
Expand Down Expand Up @@ -463,7 +442,6 @@ CustomizeMode.prototype = {
}, 0);
this._updateEmptyPaletteNotice();

this._updateThemeButtonIcon();
AddonManager.addAddonListener(this);

this._setupDownloadAutoHideToggle();
Expand Down Expand Up @@ -1825,7 +1803,6 @@ CustomizeMode.prototype = {
return;
}

await this._updateThemeButtonIcon();
if (this._nextThemeChangeUserTriggered) {
this._onUIChange();
}
Expand Down
52 changes: 0 additions & 52 deletions browser/components/uitour/test/browser_UITour_availableTargets.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,58 +74,6 @@ add_UITour_task(async function test_availableTargets_search() {
}
});

add_UITour_task(
async function test_availableTargets_removeUrlbarPageActionsAll() {
if (gProton) {
ok(
true,
"In proton actions cannot be removed from or added to the URL bar."
);
return;
}
pageActionsHelper.setActionsUrlbarState(false);
UITour.clearAvailableTargetsCache();
let data = await getConfigurationPromise("availableTargets");
let expecteds = getExpectedTargets();
ok_targets(data, expecteds);
let expectedActions = [
["pageAction-bookmark", "pageAction-panel-bookmark"],
["pageAction-copyURL", "pageAction-panel-copyURL"],
["pageAction-emailLink", "pageAction-panel-emailLink"],
["pageAction-sendToDevice", "pageAction-panel-sendToDevice"],
];
for (let [targetName, expectedNodeId] of expectedActions) {
await assertTargetNode(targetName, expectedNodeId);
}
pageActionsHelper.restoreActionsUrlbarState();
}
);

add_UITour_task(async function test_availableTargets_addUrlbarPageActionsAll() {
if (gProton) {
ok(
true,
"In proton actions cannot be removed from or added to the URL bar."
);
return;
}
pageActionsHelper.setActionsUrlbarState(true);
UITour.clearAvailableTargetsCache();
let data = await getConfigurationPromise("availableTargets");
let expecteds = getExpectedTargets();
ok_targets(data, expecteds);
let expectedActions = [
["pageAction-bookmark", "star-button-box"],
["pageAction-copyURL", "pageAction-urlbar-copyURL"],
["pageAction-emailLink", "pageAction-urlbar-emailLink"],
["pageAction-sendToDevice", "pageAction-urlbar-sendToDevice"],
];
for (let [targetName, expectedNodeId] of expectedActions) {
await assertTargetNode(targetName, expectedNodeId);
}
pageActionsHelper.restoreActionsUrlbarState();
});

function ok_targets(actualData, expectedTargets) {
// Depending on how soon after page load this is called, the selected tab icon
// may or may not be showing the loading throbber. We can't be sure whether
Expand Down
2 changes: 1 addition & 1 deletion browser/modules/test/browser/browser_PageActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -1185,7 +1185,7 @@ add_task(async function transient() {
Assert.equal(onPlacedInPanelCount, 0, "onPlacedInPanelCount should remain 0");
Assert.equal(
onBeforePlacedInWindowCount,
gProton ? 1 : 0,
1,
"onBeforePlacedInWindowCount after adding transient action"
);

Expand Down

0 comments on commit a9281ae

Please sign in to comment.