| 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 var CommandUtil = {}; | 7 var CommandUtil = {}; |
| 8 | 8 |
| 9 /** | 9 /** |
| 10 * Extracts root on which command event was dispatched. | 10 * Extracts root on which command event was dispatched. |
| (...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 canExecute: CommandUtil.canExecuteVisibleOnDriveOnly | 323 canExecute: CommandUtil.canExecuteVisibleOnDriveOnly |
| 324 }; | 324 }; |
| 325 | 325 |
| 326 /** | 326 /** |
| 327 * Clears drive cache. | 327 * Clears drive cache. |
| 328 */ | 328 */ |
| 329 Commands.driveClearCacheCommand = { | 329 Commands.driveClearCacheCommand = { |
| 330 execute: function() { | 330 execute: function() { |
| 331 chrome.fileBrowserPrivate.clearDriveCache(); | 331 chrome.fileBrowserPrivate.clearDriveCache(); |
| 332 }, | 332 }, |
| 333 canExecute: CommandUtil.canExecuteVisibleOnDriveOnly | 333 canExecute: CommandUtil.canExecuteEnabledOnDriveOnly |
| 334 }; | 334 }; |
| 335 | 335 |
| 336 /** | 336 /** |
| 337 * Reload the metadata of the file system from the server | 337 * Reload the metadata of the file system from the server |
| 338 */ | 338 */ |
| 339 Commands.driveReloadCommand = { | 339 Commands.driveReloadCommand = { |
| 340 execute: function() { | 340 execute: function() { |
| 341 chrome.fileBrowserPrivate.reloadDrive(); | 341 chrome.fileBrowserPrivate.reloadDrive(); |
| 342 }, | 342 }, |
| 343 canExecute: CommandUtil.canExecuteVisibleOnDriveOnly | 343 canExecute: CommandUtil.canExecuteEnabledOnDriveOnly |
| 344 }; | 344 }; |
| 345 | 345 |
| 346 /** | 346 /** |
| 347 * Opens drive.google.com. | 347 * Opens drive.google.com. |
| 348 */ | 348 */ |
| 349 Commands.driveGoToDriveCommand = { | 349 Commands.driveGoToDriveCommand = { |
| 350 execute: function() { | 350 execute: function() { |
| 351 window.open(FileManager.GOOGLE_DRIVE_ROOT, 'drive-root'); | 351 window.open(FileManager.GOOGLE_DRIVE_ROOT, 'drive-root'); |
| 352 }, | 352 }, |
| 353 canExecute: CommandUtil.canExecuteVisibleOnDriveOnly | 353 canExecute: CommandUtil.canExecuteVisibleOnDriveOnly |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 442 fileManager.copyManager_.zipSelection(dirEntry, fileManager.isOnDrive(), | 442 fileManager.copyManager_.zipSelection(dirEntry, fileManager.isOnDrive(), |
| 443 selectionEntries); | 443 selectionEntries); |
| 444 }, | 444 }, |
| 445 canExecute: function(event, fileManager) { | 445 canExecute: function(event, fileManager) { |
| 446 var selection = fileManager.getSelection(); | 446 var selection = fileManager.getSelection(); |
| 447 event.canExecute = !fileManager.isOnReadonlyDirectory() && | 447 event.canExecute = !fileManager.isOnReadonlyDirectory() && |
| 448 !fileManager.isOnDrive() && | 448 !fileManager.isOnDrive() && |
| 449 selection && selection.totalCount > 0; | 449 selection && selection.totalCount > 0; |
| 450 } | 450 } |
| 451 }; | 451 }; |
| OLD | NEW |