| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 * @fileoverview Objects related to incremental search. | 6 * @fileoverview Objects related to incremental search. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 goog.provide('ISearch'); | 9 goog.provide('ISearch'); |
| 10 goog.provide('ISearchHandler'); | 10 goog.provide('ISearchHandler'); |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 return ISearchUI.instance_; | 140 return ISearchUI.instance_; |
| 141 }; | 141 }; |
| 142 | 142 |
| 143 ISearchUI.prototype = { | 143 ISearchUI.prototype = { |
| 144 /** | 144 /** |
| 145 * Listens to key down events. | 145 * Listens to key down events. |
| 146 * @param {Event} evt | 146 * @param {Event} evt |
| 147 * @return {boolean} | 147 * @return {boolean} |
| 148 */ | 148 */ |
| 149 onKeyDown: function(evt) { | 149 onKeyDown: function(evt) { |
| 150 switch (evt.keyIdentifier) { | 150 switch (evt.key) { |
| 151 case 'Up': | 151 case 'ArrowUp': |
| 152 this.dir_ = Dir.BACKWARD; | 152 this.dir_ = Dir.BACKWARD; |
| 153 break; | 153 break; |
| 154 case 'Down': | 154 case 'ArrowDown': |
| 155 this.dir_ = Dir.FORWARD; | 155 this.dir_ = Dir.FORWARD; |
| 156 break; | 156 break; |
| 157 case 'U+001B': // Escape | 157 case 'Escape': |
| 158 this.pendingSearchId_ = 0; | 158 this.pendingSearchId_ = 0; |
| 159 this.background_['endExcursion'](); | 159 this.background_['endExcursion'](); |
| 160 Panel.closeMenusAndRestoreFocus(); | 160 Panel.closeMenusAndRestoreFocus(); |
| 161 return false; | 161 return false; |
| 162 case 'Enter': | 162 case 'Enter': |
| 163 this.pendingSearchId_ = 0; | 163 this.pendingSearchId_ = 0; |
| 164 this.background_['saveExcursion'](); | 164 this.background_['saveExcursion'](); |
| 165 Panel.closeMenusAndRestoreFocus(); | 165 Panel.closeMenusAndRestoreFocus(); |
| 166 return false; | 166 return false; |
| 167 default: | 167 default: |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 this.iSearch_.handler_ = null; | 216 this.iSearch_.handler_ = null; |
| 217 this.iSearch_ = null; | 217 this.iSearch_ = null; |
| 218 var input = this.input_; | 218 var input = this.input_; |
| 219 this.input_ = null; | 219 this.input_ = null; |
| 220 input.removeEventListener('keydown', this.onKeyDown, true); | 220 input.removeEventListener('keydown', this.onKeyDown, true); |
| 221 input.removeEventListener('textInput', this.onTextInput, true); | 221 input.removeEventListener('textInput', this.onTextInput, true); |
| 222 } | 222 } |
| 223 }; | 223 }; |
| 224 | 224 |
| 225 }); // goog.scope | 225 }); // goog.scope |
| OLD | NEW |