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 * Sets 'hidden' property of a cr.ui.Command instance and dispatches | 6 * Sets 'hidden' property of a cr.ui.Command instance and dispatches |
7 * 'hiddenChange' event manually so that associated cr.ui.MenuItem can handle | 7 * 'hiddenChange' event manually so that associated cr.ui.MenuItem can handle |
8 * the event. | 8 * the event. |
9 * TODO(fukino): Remove this workaround when crbug.com/481941 is fixed. | 9 * TODO(fukino): Remove this workaround when crbug.com/481941 is fixed. |
10 * | 10 * |
(...skipping 1415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1426 | 1426 |
1427 /** | 1427 /** |
1428 * Refreshes the currently selected directory. | 1428 * Refreshes the currently selected directory. |
1429 */ | 1429 */ |
1430 CommandHandler.COMMANDS_['refresh'] = /** @type {Command} */ ({ | 1430 CommandHandler.COMMANDS_['refresh'] = /** @type {Command} */ ({ |
1431 /** | 1431 /** |
1432 * @param {!Event} event Command event. | 1432 * @param {!Event} event Command event. |
1433 * @param {!FileManager} fileManager FileManager to use. | 1433 * @param {!FileManager} fileManager FileManager to use. |
1434 */ | 1434 */ |
1435 execute: function(event, fileManager) { | 1435 execute: function(event, fileManager) { |
1436 // TODO(mtomasz): Implement refreshing. | 1436 fileManager.directoryModel.rescan(true /* refresh */); |
| 1437 fileManager.spinnerController.blink(); |
1437 }, | 1438 }, |
1438 canExecute: function(event, fileManager) { | 1439 canExecute: function(event, fileManager) { |
1439 var currentDirEntry = fileManager.directoryModel.getCurrentDirEntry(); | 1440 var currentDirEntry = fileManager.directoryModel.getCurrentDirEntry(); |
1440 var volumeInfo = currentDirEntry && | 1441 var volumeInfo = currentDirEntry && |
1441 fileManager.volumeManager.getVolumeInfo(currentDirEntry); | 1442 fileManager.volumeManager.getVolumeInfo(currentDirEntry); |
1442 event.canExecute = volumeInfo && !volumeInfo.watchable; | 1443 event.canExecute = volumeInfo && !volumeInfo.watchable; |
1443 event.command.setHidden(!event.canExecute || | 1444 event.command.setHidden(!event.canExecute || |
1444 fileManager.directoryModel.getFileListSelection().getCheckSelectMode()); | 1445 fileManager.directoryModel.getFileListSelection().getCheckSelectMode()); |
1445 } | 1446 } |
1446 }); | 1447 }); |
OLD | NEW |