Index: third_party/WebKit/public/web/WebInputMethodController.h |
diff --git a/third_party/WebKit/Source/core/frame/DOMVisualViewport.h b/third_party/WebKit/public/web/WebInputMethodController.h |
similarity index 55% |
copy from third_party/WebKit/Source/core/frame/DOMVisualViewport.h |
copy to third_party/WebKit/public/web/WebInputMethodController.h |
index 2d3a1b508ecf51394124ee6055b36913d5eb5e52..e7675c9087780cf0837415bbb60b181ce4cebf33 100644 |
--- a/third_party/WebKit/Source/core/frame/DOMVisualViewport.h |
+++ b/third_party/WebKit/public/web/WebInputMethodController.h |
@@ -28,49 +28,47 @@ |
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
-#ifndef DOMVisualViewport_h |
-#define DOMVisualViewport_h |
+#ifndef WebInputMethodController_h |
+#define WebInputMethodController_h |
-#include "bindings/core/v8/ScriptWrappable.h" |
-#include "core/dom/ExecutionContext.h" |
-#include "core/events/EventTarget.h" |
-#include "platform/heap/Handle.h" |
+#include "WebCompositionUnderline.h" |
+#include "WebWidget.h" |
namespace blink { |
-class LocalDOMWindow; |
-class ExecutionContext; |
+class WebString; |
+template <typename T> |
+class WebVector; |
-class DOMVisualViewport final : public EventTargetWithInlineData { |
- DEFINE_WRAPPERTYPEINFO(); |
-public: |
- static DOMVisualViewport* create(LocalDOMWindow* window) |
- { |
- return new DOMVisualViewport(window); |
- } |
- |
- ~DOMVisualViewport() override; |
- |
- DECLARE_VIRTUAL_TRACE(); |
+class WebInputMethodController { |
- // EventTarget overrides: |
- const AtomicString& interfaceName() const override; |
- ExecutionContext* getExecutionContext() const override; |
+public: |
+ enum ConfirmCompositionBehavior { |
+ DoNotKeepSelection, |
+ KeepSelection, |
+ }; |
- double scrollLeft(); |
- double scrollTop(); |
- double pageX(); |
- double pageY(); |
- double clientWidth(); |
- double clientHeight(); |
- double scale(); |
+ 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; |
-private: |
- explicit DOMVisualViewport(LocalDOMWindow*); |
+ // 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; |
- Member<LocalDOMWindow> m_window; |
+ // Called to inform the WebWidget to confirm an ongoing composition. |
+ virtual bool finishComposingText(ConfirmCompositionBehavior selectionBehavior) = 0; |
}; |
} // namespace blink |
- |
-#endif // DOMVisualViewport_h |
+#endif |