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

Unified Diff: ui/base/ime/input_method_base.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/common/extensions/api/input_ime.json ('k') | ui/base/ime/input_method_base.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/ime/input_method_base.h
diff --git a/ui/base/ime/input_method_base.h b/ui/base/ime/input_method_base.h
index 432a80f2ab2e3922c1c30a914fe7531ddc85525d..a0ac432c63f6d567d3c5492fdc59959519f0f76f 100644
--- a/ui/base/ime/input_method_base.h
+++ b/ui/base/ime/input_method_base.h
@@ -11,6 +11,7 @@
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "base/observer_list.h"
+#include "ui/base/ime/ime_input_context_handler_interface.h"
#include "ui/base/ime/input_method.h"
#include "ui/base/ime/ui_base_ime_export.h"
#include "ui/events/event_dispatcher.h"
@@ -29,7 +30,8 @@ class TextInputClient;
// implementations.
class UI_BASE_IME_EXPORT InputMethodBase
: NON_EXPORTED_BASE(public InputMethod),
- public base::SupportsWeakPtr<InputMethodBase> {
+ public base::SupportsWeakPtr<InputMethodBase>,
+ public IMEInputContextHandlerInterface {
public:
InputMethodBase();
~InputMethodBase() override;
@@ -61,6 +63,17 @@ class UI_BASE_IME_EXPORT InputMethodBase
virtual void OnDidChangeFocusedClient(TextInputClient* focused_before,
TextInputClient* focused) {}
+ // IMEInputContextHandlerInterface:
+ void CommitText(const std::string& text) override;
+ void UpdateCompositionText(const CompositionText& text,
+ uint32_t cursor_pos,
+ bool visible) override;
+ void DeleteSurroundingText(int32_t offset, uint32_t length) override;
+
+ // Sends a fake key event for IME composing without physical key events.
+ // Returns true if the faked key event is stopped propagation.
+ bool SendFakeProcessKeyEvent(bool pressed) const;
+
// Returns true if |client| is currently focused.
bool IsTextInputClientFocused(const TextInputClient* client);
« no previous file with comments | « chrome/common/extensions/api/input_ime.json ('k') | ui/base/ime/input_method_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698