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 3389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3400 } | 3400 } |
3401 | 3401 |
3402 var urls = [entry.toURL()]; | 3402 var urls = [entry.toURL()]; |
3403 var self = this; | 3403 var self = this; |
3404 | 3404 |
3405 // To open a file, first get the mime type. | 3405 // To open a file, first get the mime type. |
3406 this.metadataCache_.get(urls, 'drive', function(props) { | 3406 this.metadataCache_.get(urls, 'drive', function(props) { |
3407 var mimeType = props[0].contentMimeType || ''; | 3407 var mimeType = props[0].contentMimeType || ''; |
3408 var mimeTypes = [mimeType]; | 3408 var mimeTypes = [mimeType]; |
3409 var openIt = function() { | 3409 var openIt = function() { |
3410 var tasks = new FileTasks(self); | 3410 if (self.dialogType == DialogType.FULL_PAGE) { |
3411 tasks.init(urls, mimeTypes); | 3411 var tasks = new FileTasks(self); |
3412 tasks.executeDefault(); | 3412 tasks.init(urls, mimeTypes); |
3413 } | 3413 tasks.executeDefault(); |
| 3414 } else { |
| 3415 self.onOk_(); |
| 3416 } |
| 3417 }; |
3414 | 3418 |
3415 // Change the current directory to the directory that contains the | 3419 // Change the current directory to the directory that contains the |
3416 // selected file. Note that this is necessary for an image or a video, | 3420 // selected file. Note that this is necessary for an image or a video, |
3417 // which should be opened in the gallery mode, as the gallery mode | 3421 // which should be opened in the gallery mode, as the gallery mode |
3418 // requires the entry to be in the current directory model. For | 3422 // requires the entry to be in the current directory model. For |
3419 // consistency, the current directory is always changed regardless of | 3423 // consistency, the current directory is always changed regardless of |
3420 // the file type. | 3424 // the file type. |
3421 entry.getParent(function(parent) { | 3425 entry.getParent(function(parent) { |
3422 var onDirectoryChanged = function(event) { | 3426 var onDirectoryChanged = function(event) { |
3423 self.directoryModel_.removeEventListener('scan-completed', | 3427 self.directoryModel_.removeEventListener('scan-completed', |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3606 * Set the flag expressing whether the ctrl key is pressed or not. | 3610 * Set the flag expressing whether the ctrl key is pressed or not. |
3607 * @param {boolean} flag New value of the flag | 3611 * @param {boolean} flag New value of the flag |
3608 * @private | 3612 * @private |
3609 */ | 3613 */ |
3610 FileManager.prototype.setCtrlKeyPressed_ = function(flag) { | 3614 FileManager.prototype.setCtrlKeyPressed_ = function(flag) { |
3611 this.ctrlKeyPressed_ = flag; | 3615 this.ctrlKeyPressed_ = flag; |
3612 this.document_.querySelector('#drive-clear-local-cache').canExecuteChange(); | 3616 this.document_.querySelector('#drive-clear-local-cache').canExecuteChange(); |
3613 this.document_.querySelector('#drive-reload').canExecuteChange(); | 3617 this.document_.querySelector('#drive-reload').canExecuteChange(); |
3614 }; | 3618 }; |
3615 })(); | 3619 })(); |
OLD | NEW |