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

Unified Diff: third_party/WebKit/Source/web/WebInputMethodControllerImpl.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
Index: third_party/WebKit/Source/web/WebInputMethodControllerImpl.h
diff --git a/third_party/WebKit/Source/web/WebInputMethodControllerImpl.h b/third_party/WebKit/Source/web/WebInputMethodControllerImpl.h
new file mode 100644
index 0000000000000000000000000000000000000000..33fcfdbcbf07b06907aa74d5a1bc6f734a3c8dc4
--- /dev/null
+++ b/third_party/WebKit/Source/web/WebInputMethodControllerImpl.h
@@ -0,0 +1,61 @@
+// 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 WebInputMethodControllerImpl_h
+#define WebInputMethodControllerImpl_h
+
+#include "platform/heap/Handle.h"
+#include "public/web/WebCompositionUnderline.h"
+#include "public/web/WebInputMethodController.h"
+
+namespace blink {
+
+class InputMethodController;
+class LocalFrame;
+class WebLocalFrameImpl;
+class WebPlugin;
+class WebString;
+
+class WebInputMethodControllerImpl : public WebInputMethodController {
+ WTF_MAKE_NONCOPYABLE(WebInputMethodControllerImpl);
+
+ public:
+ explicit WebInputMethodControllerImpl(WebLocalFrameImpl* ownerFrame);
+ ~WebInputMethodControllerImpl() override;
+
+ static WebInputMethodControllerImpl* fromFrame(LocalFrame*);
+
+ // WebInputMethodController overrides.
+ bool setComposition(const WebString& text,
+ const WebVector<WebCompositionUnderline>& underlines,
+ int selectionStart,
+ int selectionEnd) override;
+
+ // Used to ask the WebInputMethodController to either delete and ongoing
+ // composition, or insert the specified text, or move the caret according to
+ // relativeCaretPosition.
+ bool commitText(const WebString& text, int relativeCaretPosition) override;
+
+ // Called to ask the WebInputMethodController to confirm an ongoing
+ // composition.
+ bool finishComposingText(
+ ConfirmCompositionBehavior selectionBehavior) override;
+
+ void setSuppressNextKeypressEvent(bool suppress) {
+ m_suppressNextKeypressEvent = suppress;
+ }
+
+ DECLARE_TRACE();
+
+ private:
+ LocalFrame* frame() const;
+ InputMethodController& inputMethodController() const;
+ WebPlugin* focusedPluginIfInputMethodSupported() const;
+
+ WeakMember<WebLocalFrameImpl> m_webLocalFrame;
+ bool m_suppressNextKeypressEvent;
+};
+} // namespace blink
+
+#endif
« no previous file with comments | « third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp ('k') | third_party/WebKit/Source/web/WebInputMethodControllerImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698