| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 * Controller to handle naming. | 6 * Controller to handle naming. |
| 7 * | 7 * |
| 8 * @param {!ListContainer} listContainer | 8 * @param {!ListContainer} listContainer |
| 9 * @param {!cr.ui.dialogs.AlertDialog} alertDialog | 9 * @param {!cr.ui.dialogs.AlertDialog} alertDialog |
| 10 * @param {!cr.ui.dialogs.ConfirmDialog} confirmDialog | 10 * @param {!cr.ui.dialogs.ConfirmDialog} confirmDialog |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 this.listContainer_.table.updateFileMetadata(leadListItem, leadEntry); | 205 this.listContainer_.table.updateFileMetadata(leadListItem, leadEntry); |
| 206 } | 206 } |
| 207 this.listContainer_.currentList.restoreLeadItem(leadListItem); | 207 this.listContainer_.currentList.restoreLeadItem(leadListItem); |
| 208 }; | 208 }; |
| 209 | 209 |
| 210 /** | 210 /** |
| 211 * @param {Event} event Key event. | 211 * @param {Event} event Key event. |
| 212 * @private | 212 * @private |
| 213 */ | 213 */ |
| 214 NamingController.prototype.onRenameInputKeyDown_ = function(event) { | 214 NamingController.prototype.onRenameInputKeyDown_ = function(event) { |
| 215 // Ignore key events if event.keyCode is VK_PROCESSKEY(229). |
| 216 // TODO(fukino): Remove this workaround once crbug.com/644140 is fixed. |
| 217 if (event.keyCode === 229) |
| 218 return; |
| 219 |
| 215 if (!this.isRenamingInProgress()) | 220 if (!this.isRenamingInProgress()) |
| 216 return; | 221 return; |
| 217 | 222 |
| 218 // Do not move selection or lead item in list during rename. | 223 // Do not move selection or lead item in list during rename. |
| 219 if (event.key === 'ArrowUp' || event.key === 'ArrowDown') { | 224 if (event.key === 'ArrowUp' || event.key === 'ArrowDown') { |
| 220 event.stopPropagation(); | 225 event.stopPropagation(); |
| 221 } | 226 } |
| 222 | 227 |
| 223 switch (util.getKeyModifiers(event) + event.key) { | 228 switch (util.getKeyModifiers(event) + event.key) { |
| 224 case 'Escape': | 229 case 'Escape': |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 | 341 |
| 337 var parent = this.listContainer_.renameInput.parentNode; | 342 var parent = this.listContainer_.renameInput.parentNode; |
| 338 if (parent) | 343 if (parent) |
| 339 parent.removeChild(this.listContainer_.renameInput); | 344 parent.removeChild(this.listContainer_.renameInput); |
| 340 | 345 |
| 341 this.listContainer_.endBatchUpdates(); | 346 this.listContainer_.endBatchUpdates(); |
| 342 | 347 |
| 343 // Focus may go out of the list. Back it to the list. | 348 // Focus may go out of the list. Back it to the list. |
| 344 this.listContainer_.currentList.focus(); | 349 this.listContainer_.currentList.focus(); |
| 345 }; | 350 }; |
| OLD | NEW |