Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2016 Google Inc. All rights reserved. | 2 * Copyright (C) 2016 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | 21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | 22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #ifndef DOMVisualViewport_h | 31 #ifndef WebInputMethodController_h |
| 32 #define DOMVisualViewport_h | 32 #define WebInputMethodController_h |
| 33 | 33 |
| 34 #include "bindings/core/v8/ScriptWrappable.h" | 34 #include "WebCompositionUnderline.h" |
| 35 #include "core/dom/ExecutionContext.h" | 35 #include "WebWidget.h" |
| 36 #include "core/events/EventTarget.h" | |
| 37 #include "platform/heap/Handle.h" | |
| 38 | 36 |
| 39 namespace blink { | 37 namespace blink { |
| 40 | 38 |
| 41 class LocalDOMWindow; | 39 class WebString; |
| 42 class ExecutionContext; | 40 template <typename T> |
| 41 class WebVector; | |
| 43 | 42 |
| 44 class DOMVisualViewport final : public EventTargetWithInlineData { | 43 class WebInputMethodController { |
| 45 DEFINE_WRAPPERTYPEINFO(); | 44 |
| 46 public: | 45 public: |
| 47 static DOMVisualViewport* create(LocalDOMWindow* window) | 46 // Called to inform the WebInputMethodController of a new composition text. |
| 48 { | 47 // If selectionStart and selectionEnd has the same value, then it indicates |
| 49 return new DOMVisualViewport(window); | 48 // the input caret position. If the text is empty, then the existing |
| 50 } | 49 // composition text will be canceled. |
| 50 // Returns true if the composition text was set successfully. | |
| 51 virtual bool setComposition( | |
| 52 const WebString& text, | |
| 53 const WebVector<WebCompositionUnderline>& underlines, | |
| 54 int selectionStart, | |
| 55 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.
| |
| 51 | 56 |
| 52 ~DOMVisualViewport() override; | 57 // Called to inform the WebWidget that deleting the ongoing composition if |
| 58 // any, inserting the specified text, and moving the caret according to | |
| 59 // relativeCaretPosition. | |
| 60 virtual bool commitText(const WebString& text, int relativeCaretPosition) { return false; } | |
| 53 | 61 |
| 54 DECLARE_VIRTUAL_TRACE(); | 62 // Called to inform the WebWidget to confirm an ongoing composition. |
| 55 | 63 virtual bool finishComposingText(WebWidget::ConfirmCompositionBehavior selec tionBehavior) { return false; } |
| 56 // EventTarget overrides: | |
| 57 const AtomicString& interfaceName() const override; | |
| 58 ExecutionContext* getExecutionContext() const override; | |
| 59 | |
| 60 double scrollLeft(); | |
| 61 double scrollTop(); | |
| 62 double pageX(); | |
| 63 double pageY(); | |
| 64 double clientWidth(); | |
| 65 double clientHeight(); | |
| 66 double scale(); | |
| 67 | |
| 68 private: | |
| 69 explicit DOMVisualViewport(LocalDOMWindow*); | |
| 70 | |
| 71 Member<LocalDOMWindow> m_window; | |
| 72 }; | 64 }; |
| 73 | 65 |
| 74 } // namespace blink | 66 } // namespace blink |
| 75 | 67 #endif |
| 76 #endif // DOMVisualViewport_h | |
| OLD | NEW |