Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 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. | |
| 4 | |
| 5 #ifndef CONTENT_COMMON_TEXT_INPUT_STATE_H_ | |
| 6 #define CONTENT_COMMON_TEXT_INPUT_STATE_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 #include "content/common/content_export.h" | |
| 11 #include "ui/base/ime/text_input_mode.h" | |
| 12 #include "ui/base/ime/text_input_type.h" | |
| 13 | |
| 14 namespace content { | |
| 15 | |
| 16 // The text input state information for handling IME on the browser side. The | |
| 17 // text input state information such as type, mode, etc. are used by the input | |
| 18 // method to handle IME (the usage is specific to each platform). | |
| 19 // This struct is also used in TextInputManager to track | |
| 20 // text input state information on the browser side. | |
|
Charlie Reis
2016/04/26 06:13:23
nit: This last sentence seems redundant with the f
EhsanK
2016/04/26 18:02:47
Done.
| |
| 21 struct CONTENT_EXPORT TextInputState { | |
| 22 TextInputState(); | |
| 23 TextInputState(const TextInputState& other); | |
| 24 | |
| 25 // Type of the input field. | |
| 26 ui::TextInputType type; | |
| 27 | |
| 28 // The mode of input field. | |
| 29 ui::TextInputMode mode; | |
| 30 | |
| 31 // The flags of input field (autocorrect, autocomplete, etc.) | |
| 32 int flags; | |
| 33 | |
| 34 // The value of input field. | |
| 35 std::string value; | |
| 36 | |
| 37 // The cursor position of the current selection start, or the caret position | |
| 38 // if nothing is selected. | |
| 39 int selection_start; | |
| 40 | |
| 41 // The cursor position of the current selection end, or the caret position if | |
| 42 // nothing is selected. | |
| 43 int selection_end; | |
| 44 | |
| 45 // The start position of the current composition, or -1 if there is none. | |
| 46 int composition_start; | |
| 47 | |
| 48 // The end position of the current composition, or -1 if there is none. | |
| 49 int composition_end; | |
| 50 | |
| 51 // Whether or not inline composition can be performed for the current input. | |
| 52 bool can_compose_inline; | |
| 53 | |
| 54 // Whether or not the IME should be shown as a result of this update. Even if | |
| 55 // true, the IME will only be shown if the input is appropriate (e.g. not | |
| 56 // TEXT_INPUT_TYPE_NONE). | |
| 57 bool show_ime_if_needed; | |
| 58 | |
| 59 // Whether this change is originated from non-IME (e.g., Javascript, | |
| 60 // Autofill). | |
| 61 bool is_non_ime_change; | |
| 62 }; | |
| 63 | |
| 64 } // namespace content | |
| 65 | |
| 66 #endif // CONTENT_COMMON_TEXT_INPUT_STATE_H_ | |
| OLD | NEW |