зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1878401 - part 4 - Update nsIFilePicker users in devtools/ to pass BrowsingContext to init r=profiler-reviewers,devtools-reviewers,nchevobbe,julienw
Depends on D200548 Differential Revision: https://phabricator.services.mozilla.com/D200549
This commit is contained in:
Родитель
37e8e74c06
Коммит
5896e8934e
|
@ -51,7 +51,7 @@ exports.getExtensionUuid = function (extension) {
|
|||
exports.openTemporaryExtension = function (win, message) {
|
||||
return new Promise(resolve => {
|
||||
const fp = Cc["@mozilla.org/filepicker;1"].createInstance(Ci.nsIFilePicker);
|
||||
fp.init(win, message, Ci.nsIFilePicker.modeOpen);
|
||||
fp.init(win.browsingContext, message, Ci.nsIFilePicker.modeOpen);
|
||||
|
||||
// Try to set the last directory used as "displayDirectory".
|
||||
try {
|
||||
|
|
|
@ -434,7 +434,7 @@ exports.openFilePicker = function ({ title, filters, defaultName, mode }) {
|
|||
}
|
||||
|
||||
const fp = Cc["@mozilla.org/filepicker;1"].createInstance(Ci.nsIFilePicker);
|
||||
fp.init(window, title, fpMode);
|
||||
fp.init(window.browsingContext, title, fpMode);
|
||||
|
||||
for (const filter of filters || []) {
|
||||
fp.appendFilter(filter[0], filter[1]);
|
||||
|
|
|
@ -57,7 +57,7 @@ var HarMenuUtils = {
|
|||
openHarFile(actions, openSplitConsole) {
|
||||
const fp = Cc["@mozilla.org/filepicker;1"].createInstance(Ci.nsIFilePicker);
|
||||
fp.init(
|
||||
window,
|
||||
window.browsingContext,
|
||||
L10N.getStr("netmonitor.har.importHarDialogTitle"),
|
||||
Ci.nsIFilePicker.modeOpen
|
||||
);
|
||||
|
|
|
@ -153,7 +153,12 @@ function openFilePickerForObjdir(window, objdirs, changeObjdirs) {
|
|||
const FilePicker = Cc["@mozilla.org/filepicker;1"].createInstance(
|
||||
Ci.nsIFilePicker
|
||||
);
|
||||
FilePicker.init(window, "Pick build directory", FilePicker.modeGetFolder);
|
||||
FilePicker.init(
|
||||
// @ts-ignore
|
||||
window.browsingContext,
|
||||
"Pick build directory",
|
||||
FilePicker.modeGetFolder
|
||||
);
|
||||
FilePicker.open(rv => {
|
||||
if (rv == FilePicker.returnOK) {
|
||||
const path = FilePicker.file.path;
|
||||
|
|
|
@ -142,7 +142,7 @@ export function showFilePicker(
|
|||
fp.defaultString = suggestedFilename;
|
||||
}
|
||||
|
||||
fp.init(parentWindow, getString(key + ".title"), mode);
|
||||
fp.init(parentWindow.browsingContext, getString(key + ".title"), mode);
|
||||
fp.appendFilter(getString(key + ".filter"), "*.css");
|
||||
fp.appendFilters(fp.filterAll);
|
||||
fp.open(fpCallback);
|
||||
|
|
|
@ -758,7 +758,7 @@ class JSTerm extends Component {
|
|||
async _openFile() {
|
||||
const fp = Cc["@mozilla.org/filepicker;1"].createInstance(Ci.nsIFilePicker);
|
||||
fp.init(
|
||||
this.webConsoleUI.document.defaultView,
|
||||
this.webConsoleUI.document.defaultView.browsingContext,
|
||||
l10n.getStr("webconsole.input.openJavaScriptFile"),
|
||||
Ci.nsIFilePicker.modeOpen
|
||||
);
|
||||
|
|
|
@ -901,7 +901,7 @@ exports.showSaveFileDialog = function (
|
|||
fp.defaultString = suggestedFilename;
|
||||
}
|
||||
|
||||
fp.init(parentWindow, null, fp.modeSave);
|
||||
fp.init(parentWindow.browsingContext, null, fp.modeSave);
|
||||
if (Array.isArray(filters) && filters.length) {
|
||||
for (const { pattern, label } of filters) {
|
||||
fp.appendFilter(label, pattern);
|
||||
|
|
Загрузка…
Ссылка в новой задаче