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 545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
556 | 556 |
557 var commands = this.dialogDom_.querySelectorAll('command'); | 557 var commands = this.dialogDom_.querySelectorAll('command'); |
558 for (var i = 0; i < commands.length; i++) | 558 for (var i = 0; i < commands.length; i++) |
559 cr.ui.Command.decorate(commands[i]); | 559 cr.ui.Command.decorate(commands[i]); |
560 | 560 |
561 var doc = this.document_; | 561 var doc = this.document_; |
562 | 562 |
563 CommandUtil.registerCommand(this.dialogContainer_, 'newfolder', | 563 CommandUtil.registerCommand(this.dialogContainer_, 'newfolder', |
564 Commands.newFolderCommand, this, this.directoryModel_); | 564 Commands.newFolderCommand, this, this.directoryModel_); |
565 | 565 |
| 566 // Required to handle the command outside of the container, on the footer. |
| 567 // TODO(mtomasz): Remove after fixing crbug.com/275235. |
| 568 CommandUtil.registerCommand(this.dialogDom_.querySelector('.dialog-footer'), |
| 569 'newfolder', Commands.newFolderCommand, this, this.directoryModel_); |
| 570 |
566 CommandUtil.registerCommand(this.dialogContainer_, 'newwindow', | 571 CommandUtil.registerCommand(this.dialogContainer_, 'newwindow', |
567 Commands.newWindowCommand, this, this.directoryModel_); | 572 Commands.newWindowCommand, this, this.directoryModel_); |
568 | 573 |
569 CommandUtil.registerCommand(this.dialogContainer_, 'change-default-app', | 574 CommandUtil.registerCommand(this.dialogContainer_, 'change-default-app', |
570 Commands.changeDefaultAppCommand, this); | 575 Commands.changeDefaultAppCommand, this); |
571 | 576 |
572 CommandUtil.registerCommand(this.navigationList_, 'unmount', | 577 CommandUtil.registerCommand(this.navigationList_, 'unmount', |
573 Commands.unmountCommand, this); | 578 Commands.unmountCommand, this); |
574 | 579 |
575 CommandUtil.registerCommand(this.navigationList_, 'import-photos', | 580 CommandUtil.registerCommand(this.navigationList_, 'import-photos', |
(...skipping 3301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3877 */ | 3882 */ |
3878 FileManager.prototype.setCtrlKeyPressed_ = function(flag) { | 3883 FileManager.prototype.setCtrlKeyPressed_ = function(flag) { |
3879 this.ctrlKeyPressed_ = flag; | 3884 this.ctrlKeyPressed_ = flag; |
3880 // Before the DOM is constructed, the key event can be handled. | 3885 // Before the DOM is constructed, the key event can be handled. |
3881 var cacheClearCommand = | 3886 var cacheClearCommand = |
3882 this.document_.querySelector('#drive-clear-local-cache'); | 3887 this.document_.querySelector('#drive-clear-local-cache'); |
3883 if (cacheClearCommand) | 3888 if (cacheClearCommand) |
3884 cacheClearCommand.canExecuteChange(); | 3889 cacheClearCommand.canExecuteChange(); |
3885 }; | 3890 }; |
3886 })(); | 3891 })(); |
OLD | NEW |