Commit d16e054b authored by Keith Lee's avatar Keith Lee Committed by Commit Bot

Update input_method_private externs files

Update files to prevent the following presubmit warning:
** Presubmit Warnings **
Found updated extension api files without updated extern files. Please update the extern files.
  /usr/local/google/home/keithlee/chromium/src/chrome/common/extensions/api/input_method_private.json
***************
To update the externs, run:
 src/ $ python tools/json_schema_compiler/compiler.py /usr/local/google/home/keithlee/chromium/src/chrome/common/extensions/api/input_method_private.json --root=. --generator=externs > /usr/local/google/home/keithlee/chromium/src/third_party/closure_compiler/externs/input_method_private.js
***************

Change-Id: I8ad20550dfe9acc233e4e437740739b7b1b744f1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1886137Reviewed-by: default avatarKeith Lee <keithlee@chromium.org>
Reviewed-by: default avatarDevlin <rdevlin.cronin@chromium.org>
Auto-Submit: Keith Lee <keithlee@chromium.org>
Commit-Queue: Keith Lee <keithlee@chromium.org>
Cr-Commit-Position: refs/heads/master@{#710670}
parent 42700df4
// Copyright 2016 The Chromium Authors. All rights reserved.
// Copyright 2019 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.
......@@ -16,6 +16,86 @@
*/
chrome.inputMethodPrivate = {};
/**
* @enum {string}
*/
chrome.inputMethodPrivate.MenuItemStyle = {
CHECK: 'check',
RADIO: 'radio',
SEPARATOR: 'separator',
};
/**
* A menu item used by an input method to interact with the user from the language menu.
* @typedef {{
* id: string,
* label: (string|undefined),
* style: (!chrome.inputMethodPrivate.MenuItemStyle|undefined),
* visible: (boolean|undefined),
* checked: (boolean|undefined),
* enabled: (boolean|undefined)
* }}
*/
chrome.inputMethodPrivate.MenuItem;
/**
* @enum {string}
*/
chrome.inputMethodPrivate.UnderlineStyle = {
UNDERLINE: 'underline',
DOUBLE_UNDERLINE: 'doubleUnderline',
NO_UNDERLINE: 'noUnderline',
};
/**
* @enum {string}
*/
chrome.inputMethodPrivate.FocusReason = {
MOUSE: 'mouse',
TOUCH: 'touch',
PEN: 'pen',
OTHER: 'other',
};
/**
* @enum {string}
*/
chrome.inputMethodPrivate.InputContextType = {
TEXT: 'text',
SEARCH: 'search',
TEL: 'tel',
URL: 'url',
EMAIL: 'email',
NUMBER: 'number',
PASSWORD: 'password',
};
/**
* @enum {string}
*/
chrome.inputMethodPrivate.AutoCapitalizeType = {
OFF: 'off',
CHARACTERS: 'characters',
WORDS: 'words',
SENTENCES: 'sentences',
};
/**
* Describes an input Context
* @typedef {{
* contextID: number,
* type: !chrome.inputMethodPrivate.InputContextType,
* autoCorrect: boolean,
* autoComplete: boolean,
* autoCapitalize: !chrome.inputMethodPrivate.AutoCapitalizeType,
* spellCheck: boolean,
* shouldDoLearning: boolean,
* focusReason: !chrome.inputMethodPrivate.FocusReason,
* hasBeenPassword: boolean
* }}
*/
chrome.inputMethodPrivate.InputContext;
/**
* Gets configurations for input methods.
* @param {function({
......@@ -81,6 +161,92 @@ chrome.inputMethodPrivate.getEncryptSyncEnabled = function(callback) {};
*/
chrome.inputMethodPrivate.setXkbLayout = function(xkb_name, callback) {};
/**
* Fires the input.ime.onMenuItemActivated event.
* @param {string} engineID ID of the engine to use.
* @param {string} name Name of the MenuItem which was activated
*/
chrome.inputMethodPrivate.notifyImeMenuItemActivated = function(engineID, name) {};
/**
* Shows the input view window. If the input view window is already shown, this
* function will do nothing.
* @param {function():void=} callback Called when the operation completes.
*/
chrome.inputMethodPrivate.showInputView = function(callback) {};
/**
* Opens the options page for the input method extension. If the input method
* does not have options, this function will do nothing.
* @param {string} inputMethodId ID of the input method to open options for.
*/
chrome.inputMethodPrivate.openOptionsPage = function(inputMethodId) {};
/**
* Gets the composition bounds
* @param {function(!Array<{
* x: number,
* y: number,
* w: number,
* h: number
* }>):void} callback Callback which is called to provide the result
*/
chrome.inputMethodPrivate.getCompositionBounds = function(callback) {};
/**
* Gets the surrounding text of the current selection
* @param {number} beforeLength The number of characters before the current
* selection.
* @param {number} afterLength The number of characters after the current
* selection.
* @param {function({
* before: string,
* selected: string,
* after: string
* }):void} callback Callback which is called to provide the result
*/
chrome.inputMethodPrivate.getSurroundingText = function(beforeLength, afterLength, callback) {};
/**
* Gets the current value of a setting for a particular input method
* @param {string} engineID The ID of the engine (e.g. 'zh-t-i0-pinyin',
* 'xkb:us::eng')
* @param {string} key The setting to get
* @param {function((*|undefined)):void} callback Callback to receive the
* setting
*/
chrome.inputMethodPrivate.getSetting = function(engineID, key, callback) {};
/**
* Sets the value of a setting for a particular input method
* @param {string} engineID The ID of the engine (e.g. 'zh-t-i0-pinyin',
* 'xkb:us::eng')
* @param {string} key The setting to set
* @param {*} value The new value of the setting
* @param {function():void=} callback Callback to notify that the new value has
* been set
*/
chrome.inputMethodPrivate.setSetting = function(engineID, key, value, callback) {};
/**
* Set the composition range. If this extension does not own the active IME,
* this fails.
* @param {{
* contextID: number,
* selectionBefore: number,
* selectionAfter: number,
* segments: (!Array<{
* start: number,
* end: number,
* style: !chrome.inputMethodPrivate.UnderlineStyle
* }>|undefined)
* }} parameters
* @param {function(boolean):void=} callback Called when the operation completes
* with a boolean indicating if the text was accepted or not. On failure,
* chrome.runtime.lastError is set.
*/
chrome.inputMethodPrivate.setCompositionRange = function(parameters, callback) {};
/**
* Fired when the input method is changed.
* @type {!ChromeEvent}
......@@ -110,3 +276,38 @@ chrome.inputMethodPrivate.onDictionaryChanged;
* @type {!ChromeEvent}
*/
chrome.inputMethodPrivate.onImeMenuActivationChanged;
/**
* Fired when the input method or the list of active input method IDs is
* changed.
* @type {!ChromeEvent}
*/
chrome.inputMethodPrivate.onImeMenuListChanged;
/**
* Fired when the input.ime.setMenuItems or input.ime.updateMenuItems API is
* called.
* @type {!ChromeEvent}
*/
chrome.inputMethodPrivate.onImeMenuItemsChanged;
/**
* This event is sent when focus enters a text box. It is sent to all extensions
* that are listening to this event, and enabled by the user.
* @type {!ChromeEvent}
*/
chrome.inputMethodPrivate.onFocus;
/**
* This event is sent when the settings for any input method changed. It is sent
* to all extensions that are listening to this event, and enabled by the user.
* @type {!ChromeEvent}
*/
chrome.inputMethodPrivate.onSettingsChanged;
/**
* This event is sent when the screen is being mirrored or the desktop is being
* cast.
* @type {!ChromeEvent}
*/
chrome.inputMethodPrivate.onScreenProjectionChanged;
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment