| 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 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 440 }); | 440 }); |
| 441 }, | 441 }, |
| 442 canExecute: function(event, fileManager) { | 442 canExecute: function(event, fileManager) { |
| 443 event.canExecute = | 443 event.canExecute = |
| 444 fileManager.getCurrentDirectoryEntry() && | 444 fileManager.getCurrentDirectoryEntry() && |
| 445 (fileManager.dialogType === DialogType.FULL_PAGE); | 445 (fileManager.dialogType === DialogType.FULL_PAGE); |
| 446 } | 446 } |
| 447 }; | 447 }; |
| 448 | 448 |
| 449 /** | 449 /** |
| 450 * Toggles drive sync settings. |
| 451 * @type {Command} |
| 452 */ |
| 453 CommandHandler.COMMANDS_['drive-sync-settings'] = { |
| 454 execute: function(event, fileManager) { |
| 455 fileManager.toggleDriveSyncSettings(); |
| 456 }, |
| 457 canExecute: function(event, fileManager) { |
| 458 event.canExecute = fileManager.shouldShowDriveSettings(); |
| 459 event.command.setHidden(!event.canExecute); |
| 460 } |
| 461 }; |
| 462 |
| 463 /** |
| 464 * Toggles drive hosted settings. |
| 465 * @type {Command} |
| 466 */ |
| 467 CommandHandler.COMMANDS_['drive-hosted-settings'] = { |
| 468 execute: function(event, fileManager) { |
| 469 fileManager.toggleDriveHostedSettings(); |
| 470 }, |
| 471 canExecute: function(event, fileManager) { |
| 472 event.canExecute = fileManager.shouldShowDriveSettings(); |
| 473 event.command.setHidden(!event.canExecute); |
| 474 } |
| 475 }; |
| 476 |
| 477 /** |
| 450 * Deletes selected files. | 478 * Deletes selected files. |
| 451 * @type {Command} | 479 * @type {Command} |
| 452 */ | 480 */ |
| 453 CommandHandler.COMMANDS_['delete'] = { | 481 CommandHandler.COMMANDS_['delete'] = { |
| 454 execute: function(event, fileManager) { | 482 execute: function(event, fileManager) { |
| 455 fileManager.deleteSelection(); | 483 fileManager.deleteSelection(); |
| 456 }, | 484 }, |
| 457 canExecute: function(event, fileManager) { | 485 canExecute: function(event, fileManager) { |
| 458 var selection = fileManager.getSelection(); | 486 var selection = fileManager.getSelection(); |
| 459 event.canExecute = !fileManager.isOnReadonlyDirectory() && | 487 event.canExecute = !fileManager.isOnReadonlyDirectory() && |
| (...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 813 /** | 841 /** |
| 814 * Reset the zoom factor. | 842 * Reset the zoom factor. |
| 815 * @type {Command} | 843 * @type {Command} |
| 816 */ | 844 */ |
| 817 CommandHandler.COMMANDS_['zoom-reset'] = { | 845 CommandHandler.COMMANDS_['zoom-reset'] = { |
| 818 execute: function(event, fileManager) { | 846 execute: function(event, fileManager) { |
| 819 chrome.fileBrowserPrivate.zoom('reset'); | 847 chrome.fileBrowserPrivate.zoom('reset'); |
| 820 }, | 848 }, |
| 821 canExecute: CommandUtil.canExecuteAlways | 849 canExecute: CommandUtil.canExecuteAlways |
| 822 }; | 850 }; |
| OLD | NEW |