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

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

Issue 23851011: Remove unavailable shortcut silently instead of showing a confirmation dialog (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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 | Annotate | Revision Log
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 * This variable is checked in SelectFileDialogExtensionBrowserTest. 8 * This variable is checked in SelectFileDialogExtensionBrowserTest.
9 * @type {number} 9 * @type {number}
10 */ 10 */
(...skipping 1132 matching lines...) Expand 10 before | Expand all | Expand 10 after
1143 1143
1144 this.navigationList_ = this.dialogDom_.querySelector('#navigation-list'); 1144 this.navigationList_ = this.dialogDom_.querySelector('#navigation-list');
1145 NavigationList.decorate(this.navigationList_, 1145 NavigationList.decorate(this.navigationList_,
1146 this.volumeManager_, 1146 this.volumeManager_,
1147 this.directoryModel_); 1147 this.directoryModel_);
1148 this.navigationList_.fileManager = this; 1148 this.navigationList_.fileManager = this;
1149 this.navigationList_.dataModel = 1149 this.navigationList_.dataModel =
1150 new NavigationListModel(this.filesystem_, 1150 new NavigationListModel(this.filesystem_,
1151 this.directoryModel_.getRootsList(), 1151 this.directoryModel_.getRootsList(),
1152 this.folderShortcutsModel_); 1152 this.folderShortcutsModel_);
1153
1154 this.navigationList_.addEventListener(
1155 'shortcut-target-not-found',
1156 function(e) {
1157 var path = e.path;
1158 var label = e.label;
1159 this.confirm.showWithTitle(
1160 label,
1161 str('SHORTCUT_TARGET_UNAVAILABLE'),
1162 // 'Yes' is clicked.
1163 function() {
1164 this.removeFolderShortcut(path);
1165 }.bind(this));
1166 }.bind(this));
1167 }; 1153 };
1168 1154
1169 /** 1155 /**
1170 * @private 1156 * @private
1171 */ 1157 */
1172 FileManager.prototype.updateMiddleBarVisibility_ = function() { 1158 FileManager.prototype.updateMiddleBarVisibility_ = function() {
1173 var currentPath = this.directoryModel_.getCurrentDirPath(); 1159 var currentPath = this.directoryModel_.getCurrentDirPath();
1174 var driveStatus = this.volumeManager_.getDriveStatus(); 1160 var driveStatus = this.volumeManager_.getDriveStatus();
1175 var visible = 1161 var visible =
1176 DirectoryTreeUtil.isEligiblePathForDirectoryTree(currentPath) && 1162 DirectoryTreeUtil.isEligiblePathForDirectoryTree(currentPath) &&
(...skipping 2747 matching lines...) Expand 10 before | Expand all | Expand 10 after
3924 */ 3910 */
3925 FileManager.prototype.setCtrlKeyPressed_ = function(flag) { 3911 FileManager.prototype.setCtrlKeyPressed_ = function(flag) {
3926 this.ctrlKeyPressed_ = flag; 3912 this.ctrlKeyPressed_ = flag;
3927 // Before the DOM is constructed, the key event can be handled. 3913 // Before the DOM is constructed, the key event can be handled.
3928 var cacheClearCommand = 3914 var cacheClearCommand =
3929 this.document_.querySelector('#drive-clear-local-cache'); 3915 this.document_.querySelector('#drive-clear-local-cache');
3930 if (cacheClearCommand) 3916 if (cacheClearCommand)
3931 cacheClearCommand.canExecuteChange(); 3917 cacheClearCommand.canExecuteChange();
3932 }; 3918 };
3933 })(); 3919 })();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698