Skip to content

Commit

Permalink
Merge autoland to mozilla-central. a=merge
Browse files Browse the repository at this point in the history
  • Loading branch information
Butkovits Atila committed Feb 26, 2021
2 parents 1f0e608 + f64a8e2 commit 49cdffb
Show file tree
Hide file tree
Showing 325 changed files with 3,730 additions and 4,454 deletions.
9 changes: 1 addition & 8 deletions browser/actors/DecoderDoctorParent.jsm
Expand Up @@ -180,9 +180,7 @@ class DecoderDoctorParent extends JSWindowActorParent {
if (sumo) {
buttons.push({
label: gNavigatorBundle.GetStringFromName("decoder.noCodecs.button"),
accessKey: gNavigatorBundle.GetStringFromName(
"decoder.noCodecs.accesskey"
),
supportPage: sumo,
callback() {
let clickedInPref = Services.prefs.getBoolPref(
buttonClickedPref,
Expand All @@ -191,11 +189,6 @@ class DecoderDoctorParent extends JSWindowActorParent {
if (!clickedInPref) {
Services.prefs.setBoolPref(buttonClickedPref, true);
}

let baseURL = Services.urlFormatter.formatURLPref(
"app.support.baseURL"
);
window.openTrustedLinkIn(baseURL + sumo, "tab");
},
});
}
Expand Down
30 changes: 8 additions & 22 deletions browser/actors/EncryptedMediaParent.jsm
Expand Up @@ -12,12 +12,6 @@ const { XPCOMUtils } = ChromeUtils.import(
"resource://gre/modules/XPCOMUtils.jsm"
);

ChromeUtils.defineModuleGetter(
this,
"BrowserUIUtils",
"resource:///modules/BrowserUIUtils.jsm"
);

XPCOMUtils.defineLazyGetter(this, "gBrandBundle", function() {
return Services.strings.createBundle(
"chrome://branding/locale/brand.properties"
Expand Down Expand Up @@ -61,21 +55,6 @@ class EncryptedMediaParent extends JSWindowActorParent {
return true;
}

getEMEDisabledFragment(aBrowser) {
let mainMessage = gNavigatorBundle.GetStringFromName(
"emeNotifications.drmContentDisabled.message"
);
let text = gNavigatorBundle.GetStringFromName(
"emeNotifications.drmContentDisabled.learnMoreLabel"
);
let document = aBrowser.ownerDocument;
let baseURL = Services.urlFormatter.formatURLPref("app.support.baseURL");
let link = document.createXULElement("label", { is: "text-link" });
link.setAttribute("href", baseURL + "drm-content");
link.textContent = text;
return BrowserUIUtils.getLocalizedFragment(document, mainMessage, link);
}

getMessageWithBrandName(aNotificationId) {
let msgId = "emeNotifications." + aNotificationId + ".message";
return gNavigatorBundle.formatStringFromName(msgId, [
Expand Down Expand Up @@ -117,6 +96,7 @@ class EncryptedMediaParent extends JSWindowActorParent {

let notificationId;
let buttonCallback;
let supportPage;
// Notification message can be either a string or a DOM fragment.
let notificationMessage;
switch (status) {
Expand All @@ -135,7 +115,10 @@ class EncryptedMediaParent extends JSWindowActorParent {
buttonCallback = () => {
this.ensureEMEEnabled(browser, keySystem);
};
notificationMessage = this.getEMEDisabledFragment(browser);
notificationMessage = gNavigatorBundle.GetStringFromName(
"emeNotifications.drmContentDisabled.message2"
);
supportPage = "drm-content";
break;

case "cdm-not-installed":
Expand Down Expand Up @@ -167,6 +150,9 @@ class EncryptedMediaParent extends JSWindowActorParent {
}

let buttons = [];
if (supportPage) {
buttons.push({ supportPage });
}
if (buttonCallback) {
let msgPrefix = "emeNotifications." + notificationId + ".";
let btnLabelId = msgPrefix + "button.label";
Expand Down
8 changes: 6 additions & 2 deletions browser/actors/PromptParent.jsm
Expand Up @@ -291,8 +291,9 @@ class PromptParent extends JSWindowActorParent {
let bag;

if (
args.modalType === Services.prompt.MODAL_TYPE_TAB ||
args.modalType === Services.prompt.MODAL_TYPE_CONTENT
(args.modalType === Services.prompt.MODAL_TYPE_TAB ||
args.modalType === Services.prompt.MODAL_TYPE_CONTENT) &&
win?.gBrowser?.getTabDialogBox
) {
if (!browser) {
let modal_type =
Expand All @@ -319,6 +320,9 @@ class PromptParent extends JSWindowActorParent {
bag
);
} else {
// Ensure we set the correct modal type at this point.
// If we use window prompts as a fallback it may not be set.
args.modalType = Services.prompt.MODAL_TYPE_WINDOW;
// Window prompt
bag = PromptUtils.objectToPropBag(args);
Services.ww.openWindow(
Expand Down
6 changes: 4 additions & 2 deletions browser/base/content/browser-context.inc
Expand Up @@ -291,9 +291,11 @@
data-l10n-id="main-context-menu-keyword"
oncommand="AddKeywordForSearchField();"/>
<menuitem id="context-searchselect"
oncommand="BrowserSearch.loadSearchFromContext(this.searchTerms, this.usePrivate, this.principal, this.csp);"/>
oncommand="BrowserSearch.loadSearchFromContext(this.searchTerms, this.usePrivate, this.principal, this.csp, event);"
onclick="checkForMiddleClick(this, event);"/>
<menuitem id="context-searchselect-private"
oncommand="BrowserSearch.loadSearchFromContext(this.searchTerms, true, this.principal, this.csp);"/>
oncommand="BrowserSearch.loadSearchFromContext(this.searchTerms, true, this.principal, this.csp, event);"
onclick="checkForMiddleClick(this, event);"/>
<menuseparator id="context-sep-sendlinktodevice" class="sync-ui-item"
hidden="true"/>
<menu id="context-sendlinktodevice"
Expand Down
46 changes: 29 additions & 17 deletions browser/base/content/browser.js
Expand Up @@ -968,18 +968,8 @@ const gStoragePressureObserver = {
"browser.storageManager.pressureNotification.usageThresholdGB"
);
let msg = "";
let buttons = [];
let buttons = [{ supportPage: "storage-permissions" }];
let usage = subject.QueryInterface(Ci.nsISupportsPRUint64).data;
buttons.push({
"l10n-id": "space-alert-learn-more-button",
callback(notificationBar, button) {
let learnMoreURL =
Services.urlFormatter.formatURLPref("app.support.baseURL") +
"storage-permissions";
// This is a content URL, loaded from trusted UX.
openTrustedLinkIn(learnMoreURL, "tab");
},
});
if (usage < USAGE_THRESHOLD_BYTES) {
// The firefox-used space < 5GB, then warn user to free some disk space.
// This is because this usage is small and not the main cause for space issue.
Expand Down Expand Up @@ -4259,6 +4249,9 @@ const BrowserSearch = {
* The principal to use for a new window or tab.
* @param csp
* The content security policy to use for a new window or tab.
* @param flipLoadInBackground [optional]
* If a modifier/middle mouse button is used:
* Flip preference to load search in background tab.
* @param engine [optional]
* The search engine to use for the search.
* @param tab [optional]
Expand All @@ -4274,6 +4267,7 @@ const BrowserSearch = {
purpose,
triggeringPrincipal,
csp,
flipLoadInBackground = false,
engine = null,
tab = null
) {
Expand Down Expand Up @@ -4306,7 +4300,7 @@ const BrowserSearch = {
openLinkIn(submission.uri.spec, where || "current", {
private: usePrivate && !PrivateBrowsingUtils.isWindowPrivate(window),
postData: submission.postData,
inBackground,
inBackground: flipLoadInBackground ? !inBackground : inBackground,
relatedToCurrent: true,
triggeringPrincipal,
csp,
Expand All @@ -4322,19 +4316,36 @@ const BrowserSearch = {
* This should only be called from the context menu. See
* BrowserSearch.loadSearch for the preferred API.
*/
async loadSearchFromContext(terms, usePrivate, triggeringPrincipal, csp) {
async loadSearchFromContext(
terms,
usePrivate,
triggeringPrincipal,
csp,
event
) {
event = getRootEvent(event);
let where = whereToOpenLink(event);
if (where == "current") {
// override: historically search opens in new tab
where = "tab";
}
if (usePrivate && !PrivateBrowsingUtils.isWindowPrivate(window)) {
where = "window";
}
let flipLoadInBackground = event.button == 1 || event.ctrlKey;

let { engine, url } = await BrowserSearch._loadSearch(
terms,
usePrivate && !PrivateBrowsingUtils.isWindowPrivate(window)
? "window"
: "tab",
where,
usePrivate,
"contextmenu",
Services.scriptSecurityManager.createNullPrincipal(
triggeringPrincipal.originAttributes
),
csp
csp,
flipLoadInBackground
);

if (engine) {
BrowserSearchTelemetry.recordSearch(
gBrowser.selectedBrowser,
Expand Down Expand Up @@ -4378,6 +4389,7 @@ const BrowserSearch = {
"webextension",
triggeringPrincipal,
null,
false,
engine,
tab
);
Expand Down
Expand Up @@ -115,7 +115,7 @@ add_task(async function() {
"Should display storage pressure notification"
);

let prefBtn = notification.getElementsByTagName("button")[1];
let prefBtn = notification.getElementsByTagName("button")[0];
let aboutPrefPromise = openAboutPrefPromise();
prefBtn.doCommand();
await aboutPrefPromise;
Expand Down
31 changes: 4 additions & 27 deletions browser/components/BrowserGlue.jsm
Expand Up @@ -3095,29 +3095,9 @@ BrowserGlue.prototype = {
var text = placesBundle.formatStringFromName("lockPrompt.text", [
applicationName,
]);
var buttonText = placesBundle.GetStringFromName(
"lockPromptInfoButton.label"
);
var accessKey = placesBundle.GetStringFromName(
"lockPromptInfoButton.accessKey"
);

var helpTopic = "places-locked";
var url = Services.urlFormatter.formatURLPref("app.support.baseURL");
url += helpTopic;

var win = BrowserWindowTracker.getTopWindow();

var buttons = [
{
label: buttonText,
accessKey,
popup: null,
callback(aNotificationBar, aButton) {
win.openTrustedLinkIn(url, "tab");
},
},
];
var buttons = [{ supportPage: "places-locked" }];

var notifyBox = win.gBrowser.getNotificationBox();
var notification = notifyBox.appendNotification(
Expand Down Expand Up @@ -4069,15 +4049,12 @@ BrowserGlue.prototype = {
accessKey: win.gNavigatorBundle.getString(
"flashHang.helpButton.accesskey"
),
callback() {
win.openTrustedLinkIn(
"https://support.mozilla.org/kb/flash-protected-mode-autodisabled",
"tab"
);
},
link:
"https://support.mozilla.org/kb/flash-protected-mode-autodisabled",
},
];

// XXXndeakin is this notification still relevant?
win.gNotificationBox.appendNotification(
message,
"flash-hang",
Expand Down

0 comments on commit 49cdffb

Please sign in to comment.