Bug 1109146 - Pass isContentWindowPrivate from ContentClick.jsm to utilityOverlay.js for saveURL instead of passing a CPOW initiating content document. r=felipe

MozReview-Commit-ID: DWRh7ujqdy0

--HG--
extra : transplant_source : %D8%22%BDg%E6%24%2A6%26X%DB%26%E5%A3%93%18%CD%9D%B3%AF
This commit is contained in:
Jimmy Wang 2016-05-11 17:33:09 -04:00
Родитель 5d22f22620
Коммит 928a387706
3 изменённых файлов: 17 добавлений и 8 удалений

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

@ -500,7 +500,8 @@ var ClickEventHandler = {
ctrlKey: event.ctrlKey, metaKey: event.metaKey,
altKey: event.altKey, href: null, title: null,
bookmark: false, referrerPolicy: referrerPolicy,
originAttributes: principal ? principal.originAttributes : {} };
originAttributes: principal ? principal.originAttributes : {},
isContentWindowPrivate: PrivateBrowsingUtils.isContentWindowPrivate(ownerDoc.defaultView)};
if (href) {
try {

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

@ -224,13 +224,20 @@ function openLinkIn(url, where, params) {
var aIndicateErrorPageLoad = params.indicateErrorPageLoad;
if (where == "save") {
if (!aInitiatingDoc) {
Components.utils.reportError("openUILink/openLinkIn was called with " +
"where == 'save' but without initiatingDoc. See bug 814264.");
return;
}
// TODO(1073187): propagate referrerPolicy.
saveURL(url, null, null, true, true, aNoReferrer ? null : aReferrerURI, aInitiatingDoc);
// ContentClick.jsm passes isContentWindowPrivate for saveURL instead of passing a CPOW initiatingDoc
if ("isContentWindowPrivate" in params) {
saveURL(url, null, null, true, true, aNoReferrer ? null : aReferrerURI, null, params.isContentWindowPrivate);
}
else {
if (!aInitiatingDoc) {
Components.utils.reportError("openUILink/openLinkIn was called with " +
"where == 'save' but without initiatingDoc. See bug 814264.");
return;
}
saveURL(url, null, null, true, true, aNoReferrer ? null : aReferrerURI, aInitiatingDoc);
}
return;
}

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

@ -81,7 +81,8 @@ var ContentClick = {
referrerURI: browser.documentURI,
referrerPolicy: json.referrerPolicy,
noReferrer: json.noReferrer,
allowMixedContent: json.allowMixedContent };
allowMixedContent: json.allowMixedContent,
isContentWindowPrivate: json.isContentWindowPrivate};
// The new tab/window must use the same userContextId.
if (json.originAttributes.userContextId) {