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

Side by Side Diff: ui/file_manager/file_manager/foreground/js/directory_tree_naming_controller.js

Issue 1994563002: Remove the use of KeyEvent.keyIdentifier. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 * Naming controller for directory tree. 6 * Naming controller for directory tree.
7 * @param {!DirectoryModel} directoryModel 7 * @param {!DirectoryModel} directoryModel
8 * @param {!DirectoryTree} directoryTree 8 * @param {!DirectoryTree} directoryTree
9 * @param {!cr.ui.dialogs.AlertDialog} alertDialog 9 * @param {!cr.ui.dialogs.AlertDialog} alertDialog
10 * @constructor 10 * @constructor
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 }; 183 };
184 184
185 /** 185 /**
186 * Handles keydown event. 186 * Handles keydown event.
187 * @param {!Event} event 187 * @param {!Event} event
188 * @private 188 * @private
189 */ 189 */
190 DirectoryTreeNamingController.prototype.onKeyDown_ = function(event) { 190 DirectoryTreeNamingController.prototype.onKeyDown_ = function(event) {
191 event.stopPropagation(); 191 event.stopPropagation();
192 192
193 switch (util.getKeyModifiers(event) + event.keyIdentifier) { 193 switch (util.getKeyModifiers(event) + event.key) {
194 case 'U+001B': // Escape 194 case 'Escape':
195 this.cancelRename_(); 195 this.cancelRename_();
196 event.preventDefault(); 196 event.preventDefault();
197 break; 197 break;
198 198
199 case 'Enter': 199 case 'Enter':
200 this.commitRename_(); 200 this.commitRename_();
201 event.preventDefault(); 201 event.preventDefault();
202 break; 202 break;
203 } 203 }
204 }; 204 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698