Bug 926736 - Update metro caller for new return type of get directory methods in DownloadIntegration.jsm r=mbrubeck
authorRaymond Lee <raymond@raysquare.com>
Wed, 23 Oct 2013 10:07:51 +0800
changeset 166848 27d5b2984cc43700b1535888b8d79bf2b3b6e598
parent 166847 1e970a11c5767551a6b9a4bfa808f17a81156fe4
child 166849 7688cf08e31da706d6ded28bfbe0fbac3aa8f8a9
push id428
push userbbajaj@mozilla.com
push dateTue, 28 Jan 2014 00:16:25 +0000
treeherdermozilla-release@cd72a7ff3a75 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmbrubeck
bugs926736
milestone27.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 926736 - Update metro caller for new return type of get directory methods in DownloadIntegration.jsm r=mbrubeck
browser/metro/base/content/ContextCommands.js
browser/metro/base/content/browser-scripts.js
--- a/browser/metro/base/content/ContextCommands.js
+++ b/browser/metro/base/content/ContextCommands.js
@@ -363,17 +363,18 @@ var ContextCommands = {
     // prefered file extension
     let fileExtension = mediaURL.substring(mediaURL.lastIndexOf(".") + 1);
     if (fileExtension.length)
       picker.defaultExtension = fileExtension;
     picker.appendFilters(Ci.nsIFilePicker.filterImages);
 
     // prefered save location
     Task.spawn(function() {
-      picker.displayDirectory = yield Downloads.getPreferredDownloadsDirectory();
+      let preferredDir = yield Downloads.getPreferredDownloadsDirectory();
+      picker.displayDirectory = new FileUtils.File(preferredDir);
 
       try {
         let lastDir = Services.prefs.getComplexValue("browser.download.lastDir", Ci.nsILocalFile);
         if (this.isAccessibleDirectory(lastDir))
           picker.displayDirectory = lastDir;
       }
       catch (e) { }
 
--- a/browser/metro/base/content/browser-scripts.js
+++ b/browser/metro/base/content/browser-scripts.js
@@ -11,16 +11,19 @@ Cu.import("resource://gre/modules/Servic
  */
 
 XPCOMUtils.defineLazyModuleGetter(this, "Downloads",
                                   "resource://gre/modules/Downloads.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "FormHistory",
                                   "resource://gre/modules/FormHistory.jsm");
 
+XPCOMUtils.defineLazyModuleGetter(this, "FileUtils",
+                                  "resource://gre/modules/FileUtils.jsm");
+
 XPCOMUtils.defineLazyModuleGetter(this, "PageThumbs",
                                   "resource://gre/modules/PageThumbs.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "PluralForm",
                                   "resource://gre/modules/PluralForm.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils",
                                   "resource://gre/modules/PlacesUtils.jsm");