| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 | 4 |
| 5 function insertText(text) { | 5 function insertText(text) { |
| 6 chrome.send('insertText', [ text ]); | 6 chrome.send('insertText', [ text ]); |
| 7 } | 7 } |
| 8 | 8 |
| 9 function sendKeyEvent(event) { | 9 function sendKeyEvent(event) { |
| 10 chrome.send('sendKeyEvent', [ event ]); | 10 chrome.send('sendKeyEvent', [ event ]); |
| 11 } | 11 } |
| 12 | 12 |
| 13 function hideKeyboard() { |
| 14 chrome.send('hideKeyboard'); |
| 15 } |
| 16 |
| 13 (function(exports) { | 17 (function(exports) { |
| 14 /** | 18 /** |
| 15 * An array to save callbacks of each request. | 19 * An array to save callbacks of each request. |
| 16 * @type {Array.<function(Object)>} | 20 * @type {Array.<function(Object)>} |
| 17 */ | 21 */ |
| 18 var requestIdCallbackMap = []; | 22 var requestIdCallbackMap = []; |
| 19 | 23 |
| 20 /** | 24 /** |
| 21 * An incremental integer that represents a unique requestId. | 25 * An incremental integer that represents a unique requestId. |
| 22 * @type {number} | 26 * @type {number} |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 if (!requestIdCallbackMap[requestId]) | 73 if (!requestIdCallbackMap[requestId]) |
| 70 return; | 74 return; |
| 71 requestIdCallbackMap[requestId](inputContext); | 75 requestIdCallbackMap[requestId](inputContext); |
| 72 } | 76 } |
| 73 | 77 |
| 74 exports.OnTextInputBoxFocused = OnTextInputBoxFocused; | 78 exports.OnTextInputBoxFocused = OnTextInputBoxFocused; |
| 75 exports.getInputContext = GetInputContext; | 79 exports.getInputContext = GetInputContext; |
| 76 exports.cancelRequest = CancelRequest; | 80 exports.cancelRequest = CancelRequest; |
| 77 exports.GetInputContextCallback = GetInputContextCallback; | 81 exports.GetInputContextCallback = GetInputContextCallback; |
| 78 })(this); | 82 })(this); |
| OLD | NEW |