Add long running gmail memory benchmark for background tab.
[chromium-blink-merge.git] / ui / mojo / ime / text_input_state.mojom
blobdd8490d8ced5e66899da23dee0cad2524e0a0388
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 module mojo;
7 // Text input type which is based on blink::WebTextInputType.
8 enum TextInputType {
9   NONE,
10   TEXT,
11   PASSWORD,
12   SEARCH,
13   EMAIL,
14   NUMBER,
15   TELEPHONE,
16   URL,
17   DATE,
18   DATE_TIME,
19   DATE_TIME_LOCAL,
20   MONTH,
21   TIME,
22   WEEK,
23   TEXT_AREA,
26 // Text input flag which is based on blink::WebTextInputFlags.
27 enum TextInputFlag {
28   NONE,
29   AUTO_COMPLETE_ON = 0x001,
30   AUTO_COMPLETE_OFF = 0x002,
31   AUTO_CORRECT_ON = 0x004,
32   AUTO_CORRECT_OFF = 0x010,
33   SPELL_CHECK_ON = 0x020,
34   SPELL_CHECK_OFF = 0x040,
35   AUTO_CAPITALIZE_NONE = 0x080,
36   AUTO_CAPITALIZE_CHARACTERS = 0x100,
37   AUTO_CAPITALIZE_WORDS = 0x200,
38   AUTO_CAPITALIZE_SENTENCES = 0x400,
41 // Text input info which is based on blink::WebTextInputInfo.
42 struct TextInputState {
43   // The type of input field.
44   TextInputType type;
46   // The flags of the input field (autocorrect, autocomplete, etc.).
47   int32 flags;
49   // The value of the input field.
50   string text;
52   // The cursor position of the current selection start, or the caret position
53   // if nothing is selected.
54   int32 selection_start;
56   // The cursor position of the current selection end, or the caret position
57   // if nothing is selected.
58   int32 selection_end;
60   // The start position of the current composition, or -1 if there is none.
61   int32 composition_start;
63   // The end position of the current composition, or -1 if there is none.
64   int32 composition_end;
66   // Whether or not inline composition can be performed for the current input.
67   bool can_compose_inline;
69   // Whether or not the IME should be shown as a result of this update. Even if
70   // true, the IME will only be shown if the type is appropriate (e.g. not
71   // TEXT_INPUT_TYPE_NONE).
72   bool show_ime_if_needed;