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 var CLOSURE_NO_DEPS=true; | 5 var CLOSURE_NO_DEPS=true; |
6 | 6 |
7 var controller; | 7 var controller; |
8 | 8 |
9 /** | 9 /** |
10 * Armed callback to be triggered when a keyset changes. | 10 * Armed callback to be triggered when a keyset changes. |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 * @private | 217 * @private |
218 */ | 218 */ |
219 function getCurrentInputMethod_(callback) { | 219 function getCurrentInputMethod_(callback) { |
220 if (chrome.inputMethodPrivate) | 220 if (chrome.inputMethodPrivate) |
221 chrome.inputMethodPrivate.getCurrentInputMethod(callback); | 221 chrome.inputMethodPrivate.getCurrentInputMethod(callback); |
222 else | 222 else |
223 callback(''); | 223 callback(''); |
224 } | 224 } |
225 | 225 |
226 /** | 226 /** |
| 227 * Retrieve the current display size in inches. |
| 228 * @param {function} callback |
| 229 * @private |
| 230 */ |
| 231 function getDisplayInInches_(callback) { |
| 232 callback(0); |
| 233 } |
| 234 |
| 235 |
| 236 /** |
227 * Retrieve the current input method configuration. | 237 * Retrieve the current input method configuration. |
228 * @param {function} callback The callback function for processing the | 238 * @param {function} callback The callback function for processing the |
229 * name of the active input mehtod. | 239 * name of the active input mehtod. |
230 * @private | 240 * @private |
231 */ | 241 */ |
232 function getInputMethodConfig_(callback) { | 242 function getInputMethodConfig_(callback) { |
233 if (chrome.inputMethodPrivate) | 243 if (chrome.inputMethodPrivate) |
234 chrome.inputMethodPrivate.getInputMethodConfig(callback); | 244 chrome.inputMethodPrivate.getInputMethodConfig(callback); |
235 else | 245 else |
236 callback(''); | 246 callback(''); |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 return 0; | 323 return 0; |
314 } | 324 } |
315 | 325 |
316 window.inputview = { | 326 window.inputview = { |
317 commitText: commitText_, | 327 commitText: commitText_, |
318 getKeyboardConfig: getKeyboardConfig_, | 328 getKeyboardConfig: getKeyboardConfig_, |
319 getInputMethods: getInputMethods_, | 329 getInputMethods: getInputMethods_, |
320 getCurrentInputMethod: getCurrentInputMethod_, | 330 getCurrentInputMethod: getCurrentInputMethod_, |
321 getInputMethodConfig: getInputMethodConfig_, | 331 getInputMethodConfig: getInputMethodConfig_, |
322 switchToInputMethod: switchToInputMethod_, | 332 switchToInputMethod: switchToInputMethod_, |
| 333 getDisplayInInches: getDisplayInInches_, |
323 openSettings: openSettings_ | 334 openSettings: openSettings_ |
324 }; | 335 }; |
325 | 336 |
326 registerFunction('chrome.input.ime.hideInputView', function() { | 337 registerFunction('chrome.input.ime.hideInputView', function() { |
327 chrome.virtualKeyboardPrivate.hideKeyboard(); | 338 chrome.virtualKeyboardPrivate.hideKeyboard(); |
328 chrome.virtualKeyboardPrivate.lockKeyboard(false); | 339 chrome.virtualKeyboardPrivate.lockKeyboard(false); |
329 }); | 340 }); |
330 | 341 |
331 var defaultSendMessage = registerFunction('chrome.runtime.sendMessage'); | 342 var defaultSendMessage = registerFunction('chrome.runtime.sendMessage'); |
332 registerFunction('chrome.runtime.sendMessage', function(message) { | 343 registerFunction('chrome.runtime.sendMessage', function(message) { |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
411 var Controller = i18n.input.chrome.inputview.Controller; | 422 var Controller = i18n.input.chrome.inputview.Controller; |
412 Controller.DISABLE_HWT = !(opt_config && opt_config.enableHwtForTesting); | 423 Controller.DISABLE_HWT = !(opt_config && opt_config.enableHwtForTesting); |
413 onSwitchToKeyset(keyset, function() { | 424 onSwitchToKeyset(keyset, function() { |
414 chrome.virtualKeyboardPrivate.keyboardLoaded(); | 425 chrome.virtualKeyboardPrivate.keyboardLoaded(); |
415 }); | 426 }); |
416 if (controller) | 427 if (controller) |
417 controller.initialize(keyset, languageCode, passwordLayout, name); | 428 controller.initialize(keyset, languageCode, passwordLayout, name); |
418 else | 429 else |
419 controller = new Controller(keyset, languageCode, passwordLayout, name); | 430 controller = new Controller(keyset, languageCode, passwordLayout, name); |
420 }; | 431 }; |
OLD | NEW |