Bug 1353006 - Stop using sdk/window/utils in JSONViewer; r=jryans draft
authorJan Odvarko <odvarko@gmail.com>
Wed, 05 Apr 2017 15:00:31 +0200
changeset 556138 3b9f6bbca626abc0a6082cb0fdb8aff39bf62707
parent 556137 c204f9ba27c3c9852b7fade9d0c207bd8bc00eff
child 622803 8a0872724450116ac5a86d8ecf40fae591f9734a
push id52457
push userjodvarko@mozilla.com
push dateWed, 05 Apr 2017 13:01:59 +0000
reviewersjryans
bugs1353006
milestone55.0a1
Bug 1353006 - Stop using sdk/window/utils in JSONViewer; r=jryans MozReview-Commit-ID: 5znvDLtUjWO
devtools/client/jsonview/utils.js
--- a/devtools/client/jsonview/utils.js
+++ b/devtools/client/jsonview/utils.js
@@ -3,17 +3,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 const { Cu, Cc, Ci } = require("chrome");
 const Services = require("Services");
-const { getMostRecentBrowserWindow } = require("sdk/window/utils");
 
 const OPEN_FLAGS = {
   RDONLY: parseInt("0x01", 16),
   WRONLY: parseInt("0x02", 16),
   CREATE_FILE: parseInt("0x08", 16),
   APPEND: parseInt("0x10", 16),
   TRUNCATE: parseInt("0x20", 16),
   EXCL: parseInt("0x80", 16)
@@ -30,17 +29,17 @@ exports.getTargetFile = function () {
       reject(null);
       return;
     }
 
     filePickerShown = true;
 
     let fp = Cc["@mozilla.org/filepicker;1"].createInstance(Ci.nsIFilePicker);
 
-    let win = getMostRecentBrowserWindow();
+    let win = Services.wm.getMostRecentWindow("navigator:browser");
     fp.init(win, null, Ci.nsIFilePicker.modeSave);
     fp.appendFilter("JSON Files", "*.json; *.jsonp;");
     fp.appendFilters(Ci.nsIFilePicker.filterText);
     fp.appendFilters(Ci.nsIFilePicker.filterAll);
     fp.filterIndex = 0;
 
     fp.open(rv => {
       filePickerShown = false;