Bug 885319 - Implement the immersive process check in DownloadIntegration. r=paolo a=gavin
authorRaymond Lee <raymond@raysquare.com>
Fri, 25 Oct 2013 19:19:22 +0200
changeset 160850 ea44c93520abdf1d004c59c046f854df9dd93335
parent 160849 acc49061d197fe7d88126bf86647ccd45309b9ae
child 160851 bc11f51b72482cce4ec6ea2a13893e7c55e14f14
push id2961
push userlsblakk@mozilla.com
push dateMon, 28 Oct 2013 21:59:28 +0000
treeherdermozilla-beta@73ef4f13486f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspaolo, gavin
bugs885319
milestone26.0a2
Bug 885319 - Implement the immersive process check in DownloadIntegration. r=paolo a=gavin
toolkit/components/jsdownloads/src/DownloadIntegration.jsm
--- a/toolkit/components/jsdownloads/src/DownloadIntegration.jsm
+++ b/toolkit/components/jsdownloads/src/DownloadIntegration.jsm
@@ -357,17 +357,17 @@ this.DownloadIntegration = {
       let directoryPath = null;
 #ifdef XP_MACOSX
       directoryPath = yield this.getPreferredDownloadsDirectory();
 #elifdef ANDROID
       directoryPath = yield this.getSystemDownloadsDirectory();
 #else
       // For Metro mode on Windows 8,  we want searchability for documents
       // that the user chose to open with an external application.
-      if (this._isImmersiveProcess()) {
+      if (Services.metro && Services.metro.immersive) {
         directoryPath = yield this.getSystemDownloadsDirectory();
       } else {
         directoryPath = this._getDirectory("TmpD");
       }
 #endif
       throw new Task.Result(directoryPath);
     }.bind(this));
   },
@@ -449,24 +449,16 @@ this.DownloadIntegration = {
       gDownloadPlatform.downloadDone(NetUtil.newURI(aDownload.source.url),
                                      new FileUtils.File(aDownload.target.path),
                                      aDownload.contentType,
                                      aDownload.source.isPrivate);
       this.downloadDoneCalled = true;
     }.bind(this));
   },
 
-  /**
-   * Determines whether it's a Windows Metro app.
-   */
-  _isImmersiveProcess: function() {
-    // TODO: to be implemented
-    return false;
-  },
-
   /*
    * Launches a file represented by the target of a download. This can
    * open the file with the default application for the target MIME type
    * or file extension, or with a custom application if
    * aDownload.launcherPath is set.
    *
    * @param    aDownload
    *           A Download object that contains the necessary information