| Index: ui/keyboard/resources/webui/api_adapter.js
|
| diff --git a/ui/keyboard/resources/webui/api_adapter.js b/ui/keyboard/resources/webui/api_adapter.js
|
| deleted file mode 100644
|
| index 206f60dd8af772134544862638db4000e2ce4f07..0000000000000000000000000000000000000000
|
| --- a/ui/keyboard/resources/webui/api_adapter.js
|
| +++ /dev/null
|
| @@ -1,89 +0,0 @@
|
| -// Copyright (c) 2013 The Chromium Authors. All rights reserved.
|
| -// Use of this source code is governed by a BSD-style license that can be
|
| -// found in the LICENSE file.
|
| -
|
| -function insertText(text) {
|
| - chrome.send('insertText', [ text ]);
|
| -}
|
| -
|
| -function sendKeyEvent(event) {
|
| - chrome.send('sendKeyEvent', [ event ]);
|
| -}
|
| -
|
| -function hideKeyboard() {
|
| - chrome.send('hideKeyboard');
|
| -}
|
| -
|
| -function keyboardLoaded() {
|
| - chrome.send('keyboardLoaded');
|
| -}
|
| -
|
| -(function(exports) {
|
| - /**
|
| - * An array to save callbacks of each request.
|
| - * @type {Array.<function(Object)>}
|
| - */
|
| - var requestIdCallbackMap = [];
|
| -
|
| - /**
|
| - * An incremental integer that represents a unique requestId.
|
| - * @type {number}
|
| - */
|
| - var requestId = 0;
|
| -
|
| - /**
|
| - * Called when a text input box gets focus.
|
| - * @param {object} inputContext Describes an input context. It only contains
|
| - * the type of text input box at present and only "password", "number" and
|
| - * "text" are supported.
|
| - */
|
| - function OnTextInputBoxFocused(inputContext) {
|
| - // Do not want to use the system keyboard for passwords in webui.
|
| - if (inputContext.type == 'password')
|
| - inputContext.type = 'text';
|
| - keyboard.inputTypeValue = inputContext.type;
|
| - }
|
| -
|
| - /**
|
| - * Gets the context of the focused input field. The context is returned as a
|
| - * paramter in the |callback|.
|
| - * @param {function(Object)} callback The callback function after the webui
|
| - * function finished.
|
| - * @return {number} The ID of the new request.
|
| - */
|
| - function GetInputContext(callback) {
|
| - var id = requestId;
|
| - requestIdCallbackMap[id] = callback;
|
| - chrome.send('getInputContext', [ id ]);
|
| - requestId++;
|
| - return id;
|
| - }
|
| -
|
| - /**
|
| - * Cancel the callback specified by requestId.
|
| - * @param {number} requestId The requestId of the callback that about to
|
| - * cancel.
|
| - */
|
| - function CancelRequest(requestId) {
|
| - requestIdCallbackMap[requestId] = undefined;
|
| - }
|
| -
|
| - /**
|
| - * Webui function callback. Any call to chrome.send('getInputContext', [id])
|
| - * should trigger this function being called with the parameter
|
| - * inputContext.requestId == id.
|
| - * @param {Object} inputContext The context of focused input field. Note we
|
| - * only have type(input box type) and requestId fields now.
|
| - */
|
| - function GetInputContextCallback(inputContext) {
|
| - var requestId = inputContext.requestId;
|
| - if (!requestIdCallbackMap[requestId])
|
| - return;
|
| - requestIdCallbackMap[requestId](inputContext);
|
| - }
|
| -
|
| - exports.OnTextInputBoxFocused = OnTextInputBoxFocused;
|
| - exports.getInputContext = GetInputContext;
|
| - exports.cancelRequest = CancelRequest;
|
| - exports.GetInputContextCallback = GetInputContextCallback;
|
| -})(this);
|
|
|