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 14 matching lines...) Expand all Loading... | |
| 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 DOMVisualViewport_h |
| 32 #define DOMVisualViewport_h | 32 #define DOMVisualViewport_h |
| 33 | 33 |
| 34 #include "bindings/core/v8/ScriptWrappable.h" | 34 #include "bindings/core/v8/ScriptWrappable.h" |
| 35 #include "core/dom/ExecutionContext.h" | |
| 36 #include "core/events/EventTarget.h" | |
| 35 #include "platform/heap/Handle.h" | 37 #include "platform/heap/Handle.h" |
| 36 | 38 |
| 37 namespace blink { | 39 namespace blink { |
| 38 | 40 |
| 39 class LocalDOMWindow; | 41 class LocalDOMWindow; |
| 42 class ExecutionContext; | |
| 40 | 43 |
| 41 class DOMVisualViewport final | 44 class DOMVisualViewport final : public EventTargetWithInlineData { |
|
bokan
2016/06/24 21:52:37
Since EventTarget is GCFinalized and has a virtual
| |
| 42 : public GarbageCollected<DOMVisualViewport> | |
| 43 , public ScriptWrappable { | |
| 44 DEFINE_WRAPPERTYPEINFO(); | 45 DEFINE_WRAPPERTYPEINFO(); |
| 45 public: | 46 public: |
| 46 static DOMVisualViewport* create(LocalDOMWindow* window) | 47 static DOMVisualViewport* create(LocalDOMWindow* window) |
| 47 { | 48 { |
| 48 return new DOMVisualViewport(window); | 49 return new DOMVisualViewport(window); |
| 49 } | 50 } |
| 50 | 51 |
| 51 DECLARE_VIRTUAL_TRACE(); | 52 DECLARE_VIRTUAL_TRACE(); |
| 52 | 53 |
| 54 // EventTarget overrides: | |
| 55 const AtomicString& interfaceName() const override; | |
| 56 ExecutionContext* getExecutionContext() const override; | |
| 57 | |
| 53 double scrollLeft(); | 58 double scrollLeft(); |
| 54 double scrollTop(); | 59 double scrollTop(); |
| 55 void setScrollLeft(double x); | 60 void setScrollLeft(double x); |
| 56 void setScrollTop(double y); | 61 void setScrollTop(double y); |
| 57 double clientWidth(); | 62 double clientWidth(); |
| 58 double clientHeight(); | 63 double clientHeight(); |
| 59 double pageScale(); | 64 double pageScale(); |
| 60 | 65 |
| 61 private: | 66 private: |
| 62 explicit DOMVisualViewport(LocalDOMWindow*); | 67 explicit DOMVisualViewport(LocalDOMWindow*); |
| 63 | 68 |
| 64 Member<LocalDOMWindow> m_window; | 69 Member<LocalDOMWindow> m_window; |
| 65 }; | 70 }; |
| 66 | 71 |
| 67 } // namespace blink | 72 } // namespace blink |
| 68 | 73 |
| 69 #endif // DOMVisualViewport_h | 74 #endif // DOMVisualViewport_h |
| OLD | NEW |