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 'use strict'; | 5 'use strict'; |
6 | 6 |
7 /** | 7 /** |
8 * This variable is checked in SelectFileDialogExtensionBrowserTest. | 8 * This variable is checked in SelectFileDialogExtensionBrowserTest. |
9 * @type {number} | 9 * @type {number} |
10 */ | 10 */ |
(...skipping 3438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3449 } | 3449 } |
3450 | 3450 |
3451 var urls = [entry.toURL()]; | 3451 var urls = [entry.toURL()]; |
3452 var self = this; | 3452 var self = this; |
3453 | 3453 |
3454 // To open a file, first get the mime type. | 3454 // To open a file, first get the mime type. |
3455 this.metadataCache_.get(urls, 'drive', function(props) { | 3455 this.metadataCache_.get(urls, 'drive', function(props) { |
3456 var mimeType = props[0].contentMimeType || ''; | 3456 var mimeType = props[0].contentMimeType || ''; |
3457 var mimeTypes = [mimeType]; | 3457 var mimeTypes = [mimeType]; |
3458 var openIt = function() { | 3458 var openIt = function() { |
3459 var tasks = new FileTasks(self); | 3459 if (self.dialogType == DialogType.FULL_PAGE) { |
3460 tasks.init(urls, mimeTypes); | 3460 var tasks = new FileTasks(self); |
3461 tasks.executeDefault(); | 3461 tasks.init(urls, mimeTypes); |
3462 } | 3462 tasks.executeDefault(); |
| 3463 } else { |
| 3464 self.onOk_(); |
| 3465 } |
| 3466 }; |
3463 | 3467 |
3464 // Change the current directory to the directory that contains the | 3468 // Change the current directory to the directory that contains the |
3465 // selected file. Note that this is necessary for an image or a video, | 3469 // selected file. Note that this is necessary for an image or a video, |
3466 // which should be opened in the gallery mode, as the gallery mode | 3470 // which should be opened in the gallery mode, as the gallery mode |
3467 // requires the entry to be in the current directory model. For | 3471 // requires the entry to be in the current directory model. For |
3468 // consistency, the current directory is always changed regardless of | 3472 // consistency, the current directory is always changed regardless of |
3469 // the file type. | 3473 // the file type. |
3470 entry.getParent(function(parent) { | 3474 entry.getParent(function(parent) { |
3471 var onDirectoryChanged = function(event) { | 3475 var onDirectoryChanged = function(event) { |
3472 self.directoryModel_.removeEventListener('scan-completed', | 3476 self.directoryModel_.removeEventListener('scan-completed', |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3655 * Set the flag expressing whether the ctrl key is pressed or not. | 3659 * Set the flag expressing whether the ctrl key is pressed or not. |
3656 * @param {boolean} flag New value of the flag | 3660 * @param {boolean} flag New value of the flag |
3657 * @private | 3661 * @private |
3658 */ | 3662 */ |
3659 FileManager.prototype.setCtrlKeyPressed_ = function(flag) { | 3663 FileManager.prototype.setCtrlKeyPressed_ = function(flag) { |
3660 this.ctrlKeyPressed_ = flag; | 3664 this.ctrlKeyPressed_ = flag; |
3661 this.document_.querySelector('#drive-clear-local-cache').canExecuteChange(); | 3665 this.document_.querySelector('#drive-clear-local-cache').canExecuteChange(); |
3662 this.document_.querySelector('#drive-reload').canExecuteChange(); | 3666 this.document_.querySelector('#drive-reload').canExecuteChange(); |
3663 }; | 3667 }; |
3664 })(); | 3668 })(); |
OLD | NEW |