Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(192)

Side by Side Diff: ui/keyboard/resources/webui/api_adapter.js

Issue 20145004: Switch from text insertion to key press and release events on the virtual k… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Code cleanup. Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698