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

Unified Diff: third_party/WebKit/Source/web/WebInputMethodControllerImpl.h

Issue 2333813002: Introduce WebInputMethodController to blink (Closed)
Patch Set: Removed an unsued enum form WebInputMethodController Created 4 years, 3 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
Index: third_party/WebKit/Source/web/WebInputMethodControllerImpl.h
diff --git a/third_party/WebKit/Source/core/frame/DOMVisualViewport.h b/third_party/WebKit/Source/web/WebInputMethodControllerImpl.h
similarity index 51%
copy from third_party/WebKit/Source/core/frame/DOMVisualViewport.h
copy to third_party/WebKit/Source/web/WebInputMethodControllerImpl.h
index 2d3a1b508ecf51394124ee6055b36913d5eb5e52..7291acca3d55885b91302d69bb8d1441917cebc6 100644
--- a/third_party/WebKit/Source/core/frame/DOMVisualViewport.h
+++ b/third_party/WebKit/Source/web/WebInputMethodControllerImpl.h
@@ -28,49 +28,56 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef DOMVisualViewport_h
-#define DOMVisualViewport_h
+#ifndef WebInputMethodControllerImpl_h
+#define WebInputMethodControllerImpl_h
-#include "bindings/core/v8/ScriptWrappable.h"
-#include "core/dom/ExecutionContext.h"
-#include "core/events/EventTarget.h"
#include "platform/heap/Handle.h"
+#include "public/web/WebCompositionUnderline.h"
+#include "public/web/WebInputMethodController.h"
+#include "public/web/WebWidget.h"
namespace blink {
-class LocalDOMWindow;
-class ExecutionContext;
+class InputMethodController;
+class LocalFrame;
+class WebLocalFrameImpl;
+class WebPlugin;
+class WebString;
-class DOMVisualViewport final : public EventTargetWithInlineData {
- DEFINE_WRAPPERTYPEINFO();
+class WebInputMethodControllerImpl : public WebInputMethodController {
public:
- static DOMVisualViewport* create(LocalDOMWindow* window)
- {
- return new DOMVisualViewport(window);
- }
+ explicit WebInputMethodControllerImpl(WebLocalFrameImpl* ownerFrame);
+ ~WebInputMethodControllerImpl();
- ~DOMVisualViewport() override;
+ static WebInputMethodControllerImpl* fromFrame(LocalFrame*);
- DECLARE_VIRTUAL_TRACE();
+ // WebInputMethodController overrides.
+ bool setComposition(
+ const WebString& text,
+ const WebVector<WebCompositionUnderline>& underlines,
+ int selectionStart, int selectionEnd) override;
- // EventTarget overrides:
- const AtomicString& interfaceName() const override;
- ExecutionContext* getExecutionContext() const 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;
- double scrollLeft();
- double scrollTop();
- double pageX();
- double pageY();
- double clientWidth();
- double clientHeight();
- double scale();
+ // Called to ask the WebInputMethodController to confirm an ongoing
+ // composition.
+ bool finishComposingText(WebWidget::ConfirmCompositionBehavior selectionBehavior) override;
+
+ void setSuppressNextKeypressEvent(bool suppress) { m_suppressNextKeypressEvent = suppress; }
+
+ DECLARE_TRACE();
private:
- explicit DOMVisualViewport(LocalDOMWindow*);
+ LocalFrame* frame() const;
+ InputMethodController& inputMethodController() const;
+ WebPlugin* focusedPluginIfInputMethodSupported() const;
- Member<LocalDOMWindow> m_window;
+ WeakMember<WebLocalFrameImpl> m_webLocalFrame;
+ bool m_suppressNextKeypressEvent;
};
-
} // namespace blink
-#endif // DOMVisualViewport_h
+#endif

Powered by Google App Engine
This is Rietveld 408576698