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 'use strict'; | 5 'use strict'; |
6 | 6 |
7 /** | 7 /** |
8 * FileManager constructor. | 8 * FileManager constructor. |
9 * | 9 * |
10 * FileManager objects encapsulate the functionality of the file selector | 10 * FileManager objects encapsulate the functionality of the file selector |
(...skipping 2444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2455 */ | 2455 */ |
2456 FileManager.prototype.onRenameInputKeyDown_ = function(event) { | 2456 FileManager.prototype.onRenameInputKeyDown_ = function(event) { |
2457 if (!this.isRenamingInProgress()) | 2457 if (!this.isRenamingInProgress()) |
2458 return; | 2458 return; |
2459 | 2459 |
2460 // Do not move selection or lead item in list during rename. | 2460 // Do not move selection or lead item in list during rename. |
2461 if (event.keyIdentifier == 'Up' || event.keyIdentifier == 'Down') { | 2461 if (event.keyIdentifier == 'Up' || event.keyIdentifier == 'Down') { |
2462 event.stopPropagation(); | 2462 event.stopPropagation(); |
2463 } | 2463 } |
2464 | 2464 |
2465 switch (util.getKeyModifiers(event) + event.keyCode) { | 2465 switch (util.getKeyModifiers(event) + event.keyIdentifier) { |
2466 case '27': // Escape | 2466 case 'U+001B': // Escape |
2467 this.cancelRename_(); | 2467 this.cancelRename_(); |
2468 event.preventDefault(); | 2468 event.preventDefault(); |
2469 break; | 2469 break; |
2470 | 2470 |
2471 case '13': // Enter | 2471 case 'Enter': |
2472 this.commitRename_(); | 2472 this.commitRename_(); |
2473 event.preventDefault(); | 2473 event.preventDefault(); |
2474 break; | 2474 break; |
2475 } | 2475 } |
2476 }; | 2476 }; |
2477 | 2477 |
2478 /** | 2478 /** |
2479 * @type {Event} Blur event. | 2479 * @type {Event} Blur event. |
2480 * @private | 2480 * @private |
2481 */ | 2481 */ |
(...skipping 1238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3720 callback(this.preferences_); | 3720 callback(this.preferences_); |
3721 return; | 3721 return; |
3722 } | 3722 } |
3723 | 3723 |
3724 chrome.fileBrowserPrivate.getPreferences(function(prefs) { | 3724 chrome.fileBrowserPrivate.getPreferences(function(prefs) { |
3725 this.preferences_ = prefs; | 3725 this.preferences_ = prefs; |
3726 callback(prefs); | 3726 callback(prefs); |
3727 }.bind(this)); | 3727 }.bind(this)); |
3728 }; | 3728 }; |
3729 })(); | 3729 })(); |
OLD | NEW |