Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(236)

Side by Side Diff: chrome/browser/resources/file_manager/foreground/js/file_manager_commands.js

Issue 243013009: Show drive-related settings on gear menu only when Ctrl key is pressed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add comments for future improvement. Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698