Bug 1264869 - Request STORAGE permission before downloading images. r=liuche

MozReview-Commit-ID: KJGugrRw5iI

--HG--
extra : rebase_source : d1314e42071aeabc9fedd6c8f94a61eb9a271345
This commit is contained in:
Sebastian Kaspari 2016-04-15 10:22:22 +02:00
Родитель 0c76e7b388
Коммит 29eeec29d0
1 изменённых файлов: 9 добавлений и 3 удалений

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

@ -877,9 +877,15 @@ var BrowserApp = {
UITelemetry.addEvent("action.1", "contextmenu", null, "web_save_image");
UITelemetry.addEvent("save.1", "contextmenu", null, "image");
ContentAreaUtils.saveImageURL(aTarget.currentURI.spec, null, "SaveImageTitle",
false, true, aTarget.ownerDocument.documentURIObject,
aTarget.ownerDocument);
RuntimePermissions.waitForPermissions(RuntimePermissions.WRITE_EXTERNAL_STORAGE).then(function(permissionGranted) {
if (!permissionGranted) {
return;
}
ContentAreaUtils.saveImageURL(aTarget.currentURI.spec, null, "SaveImageTitle",
false, true, aTarget.ownerDocument.documentURIObject,
aTarget.ownerDocument);
});
});
NativeWindow.contextmenus.add(stringGetter("contextmenu.setImageAs"),