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

Unified Diff: third_party/WebKit/public/web/WebInputMethodController.h

Issue 2333813002: Introduce WebInputMethodController to blink (Closed)
Patch Set: Rebased Created 4 years, 1 month 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 | « third_party/WebKit/public/web/WebFrameWidget.h ('k') | third_party/WebKit/public/web/WebPlugin.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/public/web/WebInputMethodController.h
diff --git a/third_party/WebKit/public/web/WebInputMethodController.h b/third_party/WebKit/public/web/WebInputMethodController.h
new file mode 100644
index 0000000000000000000000000000000000000000..a4c6d832175d6dacd030f4bbb0e4b5bfe60f3529
--- /dev/null
+++ b/third_party/WebKit/public/web/WebInputMethodController.h
@@ -0,0 +1,47 @@
+// Copyright 2016 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.
+
+#ifndef WebInputMethodController_h
+#define WebInputMethodController_h
+
+#include "WebCompositionUnderline.h"
+#include "WebWidget.h"
+
+namespace blink {
+
+class WebString;
+template <typename T>
+class WebVector;
+
+class WebInputMethodController {
+ public:
+ enum ConfirmCompositionBehavior {
+ DoNotKeepSelection,
+ KeepSelection,
+ };
+
+ virtual ~WebInputMethodController() {}
+ // Called to inform the WebInputMethodController of a new composition text.
+ // If selectionStart and selectionEnd has the same value, then it indicates
+ // the input caret position. If the text is empty, then the existing
+ // composition text will be canceled.
+ // Returns true if the composition text was set successfully.
+ virtual bool setComposition(
+ const WebString& text,
+ const WebVector<WebCompositionUnderline>& underlines,
+ int selectionStart,
+ int selectionEnd) = 0;
+
+ // Called to inform the WebWidget that deleting the ongoing composition if
+ // any, inserting the specified text, and moving the caret according to
+ // relativeCaretPosition.
+ virtual bool commitText(const WebString& text, int relativeCaretPosition) = 0;
+
+ // Called to inform the WebWidget to confirm an ongoing composition.
+ virtual bool finishComposingText(
+ ConfirmCompositionBehavior selectionBehavior) = 0;
+};
+
+} // namespace blink
+#endif
« no previous file with comments | « third_party/WebKit/public/web/WebFrameWidget.h ('k') | third_party/WebKit/public/web/WebPlugin.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698