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

Side by Side Diff: ui/base/ime/input_method_chromeos.h

Issue 1657593007: Implement chrome.input.ime.setComposition/commitText API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use Xxx::Results::Create(). Created 4 years, 10 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
« no previous file with comments | « ui/base/ime/input_method_base.cc ('k') | ui/base/ime/input_method_chromeos.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #ifndef UI_BASE_IME_INPUT_METHOD_CHROMEOS_H_ 5 #ifndef UI_BASE_IME_INPUT_METHOD_CHROMEOS_H_
6 #define UI_BASE_IME_INPUT_METHOD_CHROMEOS_H_ 6 #define UI_BASE_IME_INPUT_METHOD_CHROMEOS_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <set> 10 #include <set>
11 #include <string> 11 #include <string>
12 12
13 #include "base/compiler_specific.h" 13 #include "base/compiler_specific.h"
14 #include "base/macros.h" 14 #include "base/macros.h"
15 #include "base/memory/scoped_ptr.h" 15 #include "base/memory/scoped_ptr.h"
16 #include "base/memory/weak_ptr.h" 16 #include "base/memory/weak_ptr.h"
17 #include "ui/base/ime/chromeos/character_composer.h" 17 #include "ui/base/ime/chromeos/character_composer.h"
18 #include "ui/base/ime/composition_text.h" 18 #include "ui/base/ime/composition_text.h"
19 #include "ui/base/ime/ime_input_context_handler_interface.h" 19 #include "ui/base/ime/ime_input_context_handler_interface.h"
20 #include "ui/base/ime/input_method_base.h" 20 #include "ui/base/ime/input_method_base.h"
21 21
22 namespace ui { 22 namespace ui {
23 23
24 // A ui::InputMethod implementation based on IBus. 24 // A ui::InputMethod implementation based on IBus.
25 class UI_BASE_IME_EXPORT InputMethodChromeOS 25 class UI_BASE_IME_EXPORT InputMethodChromeOS : public InputMethodBase {
26 : public InputMethodBase,
27 public ui::IMEInputContextHandlerInterface {
28 public: 26 public:
29 explicit InputMethodChromeOS(internal::InputMethodDelegate* delegate); 27 explicit InputMethodChromeOS(internal::InputMethodDelegate* delegate);
30 ~InputMethodChromeOS() override; 28 ~InputMethodChromeOS() override;
31 29
32 // Overridden from InputMethod: 30 // Overridden from InputMethod:
33 bool OnUntranslatedIMEMessage(const base::NativeEvent& event, 31 bool OnUntranslatedIMEMessage(const base::NativeEvent& event,
34 NativeEventResult* result) override; 32 NativeEventResult* result) override;
35 void DispatchKeyEvent(ui::KeyEvent* event) override; 33 void DispatchKeyEvent(ui::KeyEvent* event) override;
36 void OnTextInputTypeChanged(const TextInputClient* client) override; 34 void OnTextInputTypeChanged(const TextInputClient* client) override;
37 void OnCaretBoundsChanged(const TextInputClient* client) override; 35 void OnCaretBoundsChanged(const TextInputClient* client) override;
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 // input client. 80 // input client.
83 void ProcessInputMethodResult(ui::KeyEvent* event, bool filtered); 81 void ProcessInputMethodResult(ui::KeyEvent* event, bool filtered);
84 82
85 // Checks if the pending input method result needs inserting into the focused 83 // Checks if the pending input method result needs inserting into the focused
86 // text input client as a single character. 84 // text input client as a single character.
87 bool NeedInsertChar() const; 85 bool NeedInsertChar() const;
88 86
89 // Checks if there is pending input method result. 87 // Checks if there is pending input method result.
90 bool HasInputMethodResult() const; 88 bool HasInputMethodResult() const;
91 89
92 // Sends a fake key event for IME composing without physical key events.
93 // Returns true if the faked key event is stopped propagation.
94 bool SendFakeProcessKeyEvent(bool pressed) const;
95
96 // Passes keyevent and executes character composition if necessary. Returns 90 // Passes keyevent and executes character composition if necessary. Returns
97 // true if character composer comsumes key event. 91 // true if character composer comsumes key event.
98 bool ExecuteCharacterComposer(const ui::KeyEvent& event); 92 bool ExecuteCharacterComposer(const ui::KeyEvent& event);
99 93
100 // ui::IMEInputContextHandlerInterface overrides: 94 // ui::IMEInputContextHandlerInterface overrides:
101 void CommitText(const std::string& text) override; 95 void CommitText(const std::string& text) override;
102 void UpdateCompositionText(const CompositionText& text, 96 void UpdateCompositionText(const CompositionText& text,
103 uint32_t cursor_pos, 97 uint32_t cursor_pos,
104 bool visible) override; 98 bool visible) override;
105 void DeleteSurroundingText(int32_t offset, uint32_t length) override; 99 void DeleteSurroundingText(int32_t offset, uint32_t length) override;
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 139
146 // Used for making callbacks. 140 // Used for making callbacks.
147 base::WeakPtrFactory<InputMethodChromeOS> weak_ptr_factory_; 141 base::WeakPtrFactory<InputMethodChromeOS> weak_ptr_factory_;
148 142
149 DISALLOW_COPY_AND_ASSIGN(InputMethodChromeOS); 143 DISALLOW_COPY_AND_ASSIGN(InputMethodChromeOS);
150 }; 144 };
151 145
152 } // namespace ui 146 } // namespace ui
153 147
154 #endif // UI_BASE_IME_INPUT_METHOD_CHROMEOS_H_ 148 #endif // UI_BASE_IME_INPUT_METHOD_CHROMEOS_H_
OLDNEW
« no previous file with comments | « ui/base/ime/input_method_base.cc ('k') | ui/base/ime/input_method_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698