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 57% |
copy from third_party/WebKit/Source/core/frame/DOMVisualViewport.h |
copy to third_party/WebKit/public/web/WebInputMethodController.h |
index 2d3a1b508ecf51394124ee6055b36913d5eb5e52..3e99ec9602ad46a112d70574bb22503edfb6c149 100644 |
--- a/third_party/WebKit/Source/core/frame/DOMVisualViewport.h |
+++ b/third_party/WebKit/public/web/WebInputMethodController.h |
@@ -28,49 +28,40 @@ |
* 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; |
- |
- double scrollLeft(); |
- double scrollTop(); |
- double pageX(); |
- double pageY(); |
- double clientWidth(); |
- double clientHeight(); |
- double scale(); |
+public: |
+ // 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) { return false; } |
lfg
2016/09/14 19:20:26
Can you make those functions pure virtual?
EhsanK
2016/09/16 15:06:28
Acknowledged.
|
-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) { return false; } |
- Member<LocalDOMWindow> m_window; |
+ // Called to inform the WebWidget to confirm an ongoing composition. |
+ virtual bool finishComposingText(WebWidget::ConfirmCompositionBehavior selectionBehavior) { return false; } |
}; |
} // namespace blink |
- |
-#endif // DOMVisualViewport_h |
+#endif |