| 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * * Redistributions of source code must retain the above copyright | 7 * * Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * * Redistributions in binary form must reproduce the above copyright | 9 * * Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 #include "core/frame/FrameHost.h" | 30 #include "core/frame/FrameHost.h" |
| 31 #include "core/frame/LocalDOMWindow.h" | 31 #include "core/frame/LocalDOMWindow.h" |
| 32 #include "core/frame/LocalFrame.h" | 32 #include "core/frame/LocalFrame.h" |
| 33 #include "core/frame/VisualViewport.h" | 33 #include "core/frame/VisualViewport.h" |
| 34 #include "core/page/Page.h" | 34 #include "core/page/Page.h" |
| 35 #include "core/style/ComputedStyle.h" | 35 #include "core/style/ComputedStyle.h" |
| 36 | 36 |
| 37 namespace blink { | 37 namespace blink { |
| 38 | 38 |
| 39 DOMVisualViewport::DOMVisualViewport(LocalDOMWindow* window) | 39 DOMVisualViewport::DOMVisualViewport(LocalDOMWindow* window) |
| 40 : m_window(window) {} | 40 : m_window(window) |
| 41 { |
| 42 } |
| 43 |
| 44 DOMVisualViewport::~DOMVisualViewport() |
| 45 { |
| 46 } |
| 41 | 47 |
| 42 DEFINE_TRACE(DOMVisualViewport) | 48 DEFINE_TRACE(DOMVisualViewport) |
| 43 { | 49 { |
| 44 visitor->trace(m_window); | 50 visitor->trace(m_window); |
| 51 EventTargetWithInlineData::trace(visitor); |
| 52 } |
| 53 |
| 54 const AtomicString& DOMVisualViewport::interfaceName() const |
| 55 { |
| 56 return EventTargetNames::DOMVisualViewport; |
| 57 } |
| 58 |
| 59 ExecutionContext* DOMVisualViewport::getExecutionContext() const |
| 60 { |
| 61 return m_window->getExecutionContext(); |
| 45 } | 62 } |
| 46 | 63 |
| 47 double DOMVisualViewport::scrollLeft() | 64 double DOMVisualViewport::scrollLeft() |
| 48 { | 65 { |
| 49 LocalFrame* frame = m_window->frame(); | 66 LocalFrame* frame = m_window->frame(); |
| 50 if (!frame || !frame->isMainFrame()) | 67 if (!frame || !frame->isMainFrame()) |
| 51 return 0; | 68 return 0; |
| 52 | 69 |
| 53 if (FrameHost* host = frame->host()) | 70 if (FrameHost* host = frame->host()) |
| 54 return host->visualViewport().scrollLeft(); | 71 return host->visualViewport().scrollLeft(); |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 if (!frame->isMainFrame()) | 148 if (!frame->isMainFrame()) |
| 132 return 1; | 149 return 1; |
| 133 | 150 |
| 134 if (FrameHost* host = m_window->frame()->host()) | 151 if (FrameHost* host = m_window->frame()->host()) |
| 135 return host->visualViewport().pageScale(); | 152 return host->visualViewport().pageScale(); |
| 136 | 153 |
| 137 return 0; | 154 return 0; |
| 138 } | 155 } |
| 139 | 156 |
| 140 } // namespace blink | 157 } // namespace blink |
| OLD | NEW |