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 590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
601 CommandUtil.registerCommand(doc, 'gdata-reload', | 601 CommandUtil.registerCommand(doc, 'gdata-reload', |
602 Commands.gdataReloadCommand, this); | 602 Commands.gdataReloadCommand, this); |
603 | 603 |
604 CommandUtil.registerCommand(doc, 'gdata-go-to-drive', | 604 CommandUtil.registerCommand(doc, 'gdata-go-to-drive', |
605 Commands.gdataGoToDriveCommand, this); | 605 Commands.gdataGoToDriveCommand, this); |
606 | 606 |
607 CommandUtil.registerCommand(doc, 'paste', | 607 CommandUtil.registerCommand(doc, 'paste', |
608 Commands.pasteFileCommand, doc, this.fileTransferController_); | 608 Commands.pasteFileCommand, doc, this.fileTransferController_); |
609 | 609 |
610 CommandUtil.registerCommand(doc, 'open-with', | 610 CommandUtil.registerCommand(doc, 'open-with', |
611 Commands.openWithCommand, this); | 611 Commands.openWithCommand, this); |
| 612 |
| 613 CommandUtil.registerCommand(doc, 'zip-selection', |
| 614 Commands.zipSelectionCommand, this); |
612 | 615 |
613 CommandUtil.registerCommand(doc, 'cut', Commands.defaultCommand, doc); | 616 CommandUtil.registerCommand(doc, 'cut', Commands.defaultCommand, doc); |
614 CommandUtil.registerCommand(doc, 'copy', Commands.defaultCommand, doc); | 617 CommandUtil.registerCommand(doc, 'copy', Commands.defaultCommand, doc); |
615 | 618 |
616 var inputs = this.dialogDom_.querySelectorAll( | 619 var inputs = this.dialogDom_.querySelectorAll( |
617 'input[type=text], input[type=search], textarea'); | 620 'input[type=text], input[type=search], textarea'); |
618 | 621 |
619 for (i = 0; i < inputs.length; i++) { | 622 for (i = 0; i < inputs.length; i++) { |
620 cr.ui.contextMenuHandler.setContextMenu(inputs[i], this.textContextMenu_); | 623 cr.ui.contextMenuHandler.setContextMenu(inputs[i], this.textContextMenu_); |
621 this.registerInputCommands_(inputs[i]); | 624 this.registerInputCommands_(inputs[i]); |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
753 | 756 |
754 this.filePopup_ = null; | 757 this.filePopup_ = null; |
755 | 758 |
756 this.dialogDom_.querySelector('#search-box').addEventListener( | 759 this.dialogDom_.querySelector('#search-box').addEventListener( |
757 'input', this.onSearchBoxUpdate_.bind(this)); | 760 'input', this.onSearchBoxUpdate_.bind(this)); |
758 | 761 |
759 this.defaultActionMenuItem_ = | 762 this.defaultActionMenuItem_ = |
760 this.dialogDom_.querySelector('#default-action'); | 763 this.dialogDom_.querySelector('#default-action'); |
761 | 764 |
762 this.openWithCommand_ = | 765 this.openWithCommand_ = |
763 this.dialogDom_.querySelector('#open-with'); | 766 this.dialogDom_.querySelector('#open-with'); |
764 | 767 |
765 this.defaultActionMenuItem_.addEventListener('activate', | 768 this.defaultActionMenuItem_.addEventListener('activate', |
766 this.dispatchSelectionAction_.bind(this)); | 769 this.dispatchSelectionAction_.bind(this)); |
767 | 770 |
768 this.fileTypeSelector_ = this.dialogDom_.querySelector('#file-type'); | 771 this.fileTypeSelector_ = this.dialogDom_.querySelector('#file-type'); |
769 this.initFileTypeFilter_(); | 772 this.initFileTypeFilter_(); |
770 | 773 |
771 this.updateWindowState_(); | 774 this.updateWindowState_(); |
772 // Populate the static localized strings. | 775 // Populate the static localized strings. |
773 i18nTemplate.process(this.document_, loadTimeData); | 776 i18nTemplate.process(this.document_, loadTimeData); |
(...skipping 2591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3365 return this.directoryModel_.getFileList(); | 3368 return this.directoryModel_.getFileList(); |
3366 }; | 3369 }; |
3367 | 3370 |
3368 /** | 3371 /** |
3369 * @return {cr.ui.List} Current list object. | 3372 * @return {cr.ui.List} Current list object. |
3370 */ | 3373 */ |
3371 FileManager.prototype.getCurrentList = function() { | 3374 FileManager.prototype.getCurrentList = function() { |
3372 return this.currentList_; | 3375 return this.currentList_; |
3373 }; | 3376 }; |
3374 })(); | 3377 })(); |
OLD | NEW |