OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 'use strict'; | 4 'use strict'; |
5 | 5 |
6 /** | 6 /** |
7 * This class is a base class of each input method implementation. | 7 * This class is a base class of each input method implementation. |
8 * @constructor | 8 * @constructor |
9 */ | 9 */ |
10 var IMEBase = function() {}; | 10 var IMEBase = function() {}; |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 | 131 |
132 /** | 132 /** |
133 * Called from chrome.input.ime.onFocus. | 133 * Called from chrome.input.ime.onFocus. |
134 * @private | 134 * @private |
135 * @this EngineBridge | 135 * @this EngineBridge |
136 **/ | 136 **/ |
137 onFocus_: function(context) { | 137 onFocus_: function(context) { |
138 this.focusedContext_ = context; | 138 this.focusedContext_ = context; |
139 if (this.activeEngine_) | 139 if (this.activeEngine_) |
140 this.engineInstance_[this.activeEngine_].onFocus(context); | 140 this.engineInstance_[this.activeEngine_].onFocus(context); |
141 chrome.test.sendMessage('onFocus'); | 141 chrome.test.sendMessage('onFocus:' + context.type); |
142 }, | 142 }, |
143 | 143 |
144 /** | 144 /** |
145 * Called from chrome.input.ime.onBlur. | 145 * Called from chrome.input.ime.onBlur. |
146 * @private | 146 * @private |
147 * @this EngineBridge | 147 * @this EngineBridge |
148 **/ | 148 **/ |
149 onBlur_: function(contextID) { | 149 onBlur_: function(contextID) { |
150 if (this.activeEngine_) | 150 if (this.activeEngine_) |
151 this.engineInstance_[this.activeEngine_].onBlur(contextID); | 151 this.engineInstance_[this.activeEngine_].onBlur(contextID); |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 chrome.input.ime.onReset.addListener(this.onReset_.bind(this)); | 269 chrome.input.ime.onReset.addListener(this.onReset_.bind(this)); |
270 } | 270 } |
271 }; | 271 }; |
272 | 272 |
273 var engineBridge = new EngineBridge(); | 273 var engineBridge = new EngineBridge(); |
274 engineBridge.Initialize(); | 274 engineBridge.Initialize(); |
275 engineBridge.addEngine('IdentityIME', new IdentityIME()); | 275 engineBridge.addEngine('IdentityIME', new IdentityIME()); |
276 engineBridge.addEngine('ToUpperIME', new ToUpperIME()); | 276 engineBridge.addEngine('ToUpperIME', new ToUpperIME()); |
277 engineBridge.addEngine('APIArgumentIME', new APIArgumentIME()); | 277 engineBridge.addEngine('APIArgumentIME', new APIArgumentIME()); |
278 chrome.test.sendMessage('ReadyToUseImeEvent'); | 278 chrome.test.sendMessage('ReadyToUseImeEvent'); |
OLD | NEW |