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) { |
| 10 chrome.send('sendKeyEvent', [ event ]); |
| 11 } |
| 12 |
9 (function(exports) { | 13 (function(exports) { |
10 /** | 14 /** |
11 * An array to save callbacks of each request. | 15 * An array to save callbacks of each request. |
12 * @type {Array.<function(Object)>} | 16 * @type {Array.<function(Object)>} |
13 */ | 17 */ |
14 var requestIdCallbackMap = []; | 18 var requestIdCallbackMap = []; |
15 | 19 |
16 /** | 20 /** |
17 * An incremental integer that represents a unique requestId. | 21 * An incremental integer that represents a unique requestId. |
18 * @type {number} | 22 * @type {number} |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 var requestId = inputContext.requestId; | 58 var requestId = inputContext.requestId; |
55 if (!requestIdCallbackMap[requestId]) | 59 if (!requestIdCallbackMap[requestId]) |
56 return; | 60 return; |
57 requestIdCallbackMap[requestId](inputContext); | 61 requestIdCallbackMap[requestId](inputContext); |
58 } | 62 } |
59 | 63 |
60 exports.getInputContext = GetInputContext; | 64 exports.getInputContext = GetInputContext; |
61 exports.cancelRequest = CancelRequest; | 65 exports.cancelRequest = CancelRequest; |
62 exports.GetInputContextCallback = GetInputContextCallback; | 66 exports.GetInputContextCallback = GetInputContextCallback; |
63 })(this); | 67 })(this); |
OLD | NEW |