OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 /** | 5 /** |
6 * FileManager constructor. | 6 * FileManager constructor. |
7 * | 7 * |
8 * FileManager objects encapsulate the functionality of the file selector | 8 * FileManager objects encapsulate the functionality of the file selector |
9 * dialogs, as well as the full screen file manager application (though the | 9 * dialogs, as well as the full screen file manager application (though the |
10 * latter is not yet implemented). | 10 * latter is not yet implemented). |
(...skipping 2890 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2901 * Resolves selected file urls returned from an Open dialog. | 2901 * Resolves selected file urls returned from an Open dialog. |
2902 * | 2902 * |
2903 * For gdata files this involves some special treatment. | 2903 * For gdata files this involves some special treatment. |
2904 * Starts getting gdata files if needed. | 2904 * Starts getting gdata files if needed. |
2905 * | 2905 * |
2906 * @param {Array.<string>} fileUrls GData URLs. | 2906 * @param {Array.<string>} fileUrls GData URLs. |
2907 * @param {function(Array.<string>)} callback To be called with fixed URLs. | 2907 * @param {function(Array.<string>)} callback To be called with fixed URLs. |
2908 */ | 2908 */ |
2909 FileManager.prototype.resolveSelectResults_ = function(fileUrls, callback) { | 2909 FileManager.prototype.resolveSelectResults_ = function(fileUrls, callback) { |
2910 if (this.isOnGData()) { | 2910 if (this.isOnGData()) { |
2911 chrome.fileBrowserPrivate.getGDataFiles( | 2911 chrome.fileBrowserPrivate.getDriveFiles( |
2912 fileUrls, | 2912 fileUrls, |
2913 function(localPaths) { | 2913 function(localPaths) { |
2914 fileUrls = [].concat(fileUrls); // Clone the array. | 2914 fileUrls = [].concat(fileUrls); // Clone the array. |
2915 // localPath can be empty if the file is not present, which | 2915 // localPath can be empty if the file is not present, which |
2916 // can happen if the user specifies a new file name to save a | 2916 // can happen if the user specifies a new file name to save a |
2917 // file on gdata. | 2917 // file on gdata. |
2918 for (var i = 0; i != localPaths.length; i++) { | 2918 for (var i = 0; i != localPaths.length; i++) { |
2919 if (localPaths[i]) { | 2919 if (localPaths[i]) { |
2920 // Add "localPath" parameter to the gdata file URL. | 2920 // Add "localPath" parameter to the gdata file URL. |
2921 fileUrls[i] += '?localPath=' + encodeURIComponent(localPaths[i]); | 2921 fileUrls[i] += '?localPath=' + encodeURIComponent(localPaths[i]); |
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3376 return this.directoryModel_.getFileList(); | 3376 return this.directoryModel_.getFileList(); |
3377 }; | 3377 }; |
3378 | 3378 |
3379 /** | 3379 /** |
3380 * @return {cr.ui.List} Current list object. | 3380 * @return {cr.ui.List} Current list object. |
3381 */ | 3381 */ |
3382 FileManager.prototype.getCurrentList = function() { | 3382 FileManager.prototype.getCurrentList = function() { |
3383 return this.currentList_; | 3383 return this.currentList_; |
3384 }; | 3384 }; |
3385 })(); | 3385 })(); |
OLD | NEW |