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 1468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1479 if (foundLeaf) { | 1479 if (foundLeaf) { |
1480 // TODO(kaznacheev): use |makeFIlesystemUrl| instead of | 1480 // TODO(kaznacheev): use |makeFIlesystemUrl| instead of |
1481 // self.selection. | 1481 // self.selection. |
1482 var tasks = new FileTasks(self, [self.selection.urls[0]]); | 1482 var tasks = new FileTasks(self, [self.selection.urls[0]]); |
1483 // There are 3 ways we can get here: | 1483 // There are 3 ways we can get here: |
1484 // 1. Invoked from file_manager_util::ViewFile. This can only | 1484 // 1. Invoked from file_manager_util::ViewFile. This can only |
1485 // happen for 'gallery' and 'mount-archive' actions. | 1485 // happen for 'gallery' and 'mount-archive' actions. |
1486 // 2. Reloading a Gallery page. Must be an image or a video file. | 1486 // 2. Reloading a Gallery page. Must be an image or a video file. |
1487 // 3. A user manually entered a URL pointing to a file. | 1487 // 3. A user manually entered a URL pointing to a file. |
1488 if (FileType.isImageOrVideo(path)) { | 1488 if (FileType.isImageOrVideo(path)) { |
1489 tasks.execute(self.getExtensionId() + '|gallery'); | 1489 tasks.execute(util.getExtensionId() + '|gallery'); |
1490 } else if (FileType.getMediaType(path) == 'archive') { | 1490 } else if (FileType.getMediaType(path) == 'archive') { |
1491 self.show_(); | 1491 self.show_(); |
1492 tasks.execute(self.getExtensionId() + '|mount-archive'); | 1492 tasks.execute(util.getExtensionId() + '|mount-archive'); |
1493 } else { | 1493 } else { |
1494 self.show_(); | 1494 self.show_(); |
1495 return; | 1495 return; |
1496 } | 1496 } |
1497 } | 1497 } |
1498 } | 1498 } |
1499 this.directoryModel_.setupPath(path, onLoadedActivateLeaf, onResolve); | 1499 this.directoryModel_.setupPath(path, onLoadedActivateLeaf, onResolve); |
1500 return; | 1500 return; |
1501 } | 1501 } |
1502 | 1502 |
(...skipping 891 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2394 | 2394 |
2395 function setVisibility(visibility) { | 2395 function setVisibility(visibility) { |
2396 panel.setAttribute('visibility', visibility); | 2396 panel.setAttribute('visibility', visibility); |
2397 } | 2397 } |
2398 }; | 2398 }; |
2399 | 2399 |
2400 FileManager.prototype.isOnGData = function() { | 2400 FileManager.prototype.isOnGData = function() { |
2401 return this.directoryModel_.getCurrentRootType() === RootType.GDATA; | 2401 return this.directoryModel_.getCurrentRootType() === RootType.GDATA; |
2402 }; | 2402 }; |
2403 | 2403 |
2404 FileManager.prototype.getExtensionId = function() { | |
2405 return chrome.extension.getURL('').split('/')[2]; | |
2406 }; | |
2407 | |
2408 FileManager.prototype.onExternalLinkClick_ = function(url) { | 2404 FileManager.prototype.onExternalLinkClick_ = function(url) { |
2409 chrome.tabs.create({url: url}); | 2405 chrome.tabs.create({url: url}); |
2410 if (this.dialogType_ != FileManager.DialogType.FULL_PAGE) { | 2406 if (this.dialogType_ != FileManager.DialogType.FULL_PAGE) { |
2411 this.onCancel_(); | 2407 this.onCancel_(); |
2412 } | 2408 } |
2413 }; | 2409 }; |
2414 | 2410 |
2415 /** | 2411 /** |
2416 * Task combobox handler. | 2412 * Task combobox handler. |
2417 * | 2413 * |
(...skipping 1777 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4195 } | 4191 } |
4196 | 4192 |
4197 var defaultActionSeparator = | 4193 var defaultActionSeparator = |
4198 this.dialogDom_.querySelector('#default-action-separator'); | 4194 this.dialogDom_.querySelector('#default-action-separator'); |
4199 | 4195 |
4200 this.defaultActionMenuItem_.hidden = !taskItem; | 4196 this.defaultActionMenuItem_.hidden = !taskItem; |
4201 defaultActionSeparator.hidden = !taskItem; | 4197 defaultActionSeparator.hidden = !taskItem; |
4202 } | 4198 } |
4203 })(); | 4199 })(); |
4204 | 4200 |
OLD | NEW |