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 * TODO(dzvorygin): Here we use this hack, since 'hidden' is standard | 8 * TODO(dzvorygin): Here we use this hack, since 'hidden' is standard |
9 * attribute and we can't use it's setter as usual. | 9 * attribute and we can't use it's setter as usual. |
10 * @param {boolean} value New value of hidden property. | 10 * @param {boolean} value New value of hidden property. |
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
526 | 526 |
527 /** | 527 /** |
528 * Initiates file renaming. | 528 * Initiates file renaming. |
529 * @type {Command} | 529 * @type {Command} |
530 */ | 530 */ |
531 CommandHandler.COMMANDS_['rename'] = { | 531 CommandHandler.COMMANDS_['rename'] = { |
532 execute: function(event, fileManager) { | 532 execute: function(event, fileManager) { |
533 fileManager.initiateRename(); | 533 fileManager.initiateRename(); |
534 }, | 534 }, |
535 canExecute: function(event, fileManager) { | 535 canExecute: function(event, fileManager) { |
| 536 var allowRenamingWhileOffline = |
| 537 fileManager.directoryModel.getCurrentRootType() === RootType.DRIVE; |
536 var selection = fileManager.getSelection(); | 538 var selection = fileManager.getSelection(); |
537 event.canExecute = | 539 event.canExecute = |
538 !fileManager.isRenamingInProgress() && | 540 !fileManager.isRenamingInProgress() && |
539 !fileManager.isOnReadonlyDirectory() && | 541 (!fileManager.isOnReadonlyDirectory() || allowRenamingWhileOffline) && |
540 selection && | 542 selection && |
541 selection.totalCount == 1; | 543 selection.totalCount == 1; |
542 } | 544 } |
543 }; | 545 }; |
544 | 546 |
545 /** | 547 /** |
546 * Opens drive help. | 548 * Opens drive help. |
547 * @type {Command} | 549 * @type {Command} |
548 */ | 550 */ |
549 CommandHandler.COMMANDS_['volume-help'] = { | 551 CommandHandler.COMMANDS_['volume-help'] = { |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
845 /** | 847 /** |
846 * Reset the zoom factor. | 848 * Reset the zoom factor. |
847 * @type {Command} | 849 * @type {Command} |
848 */ | 850 */ |
849 CommandHandler.COMMANDS_['zoom-reset'] = { | 851 CommandHandler.COMMANDS_['zoom-reset'] = { |
850 execute: function(event, fileManager) { | 852 execute: function(event, fileManager) { |
851 chrome.fileBrowserPrivate.zoom('reset'); | 853 chrome.fileBrowserPrivate.zoom('reset'); |
852 }, | 854 }, |
853 canExecute: CommandUtil.canExecuteAlways | 855 canExecute: CommandUtil.canExecuteAlways |
854 }; | 856 }; |
OLD | NEW |