OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "core/css/MediaValuesInitialViewport.h" | 5 #include "core/css/MediaValuesInitialViewport.h" |
6 | 6 |
7 #include "core/dom/Document.h" | 7 #include "core/dom/Document.h" |
8 #include "core/frame/FrameView.h" | 8 #include "core/frame/FrameView.h" |
9 #include "core/frame/LocalFrame.h" | 9 #include "core/frame/LocalFrame.h" |
10 #include "core/layout/api/LayoutViewItem.h" | 10 #include "core/layout/api/LayoutViewItem.h" |
11 | 11 |
12 namespace blink { | 12 namespace blink { |
13 | 13 |
14 MediaValues* MediaValuesInitialViewport::create(LocalFrame& frame) { | 14 MediaValuesInitialViewport* MediaValuesInitialViewport::create( |
| 15 LocalFrame& frame) { |
15 return new MediaValuesInitialViewport(frame); | 16 return new MediaValuesInitialViewport(frame); |
16 } | 17 } |
17 | 18 |
18 MediaValuesInitialViewport::MediaValuesInitialViewport(LocalFrame& frame) | 19 MediaValuesInitialViewport::MediaValuesInitialViewport(LocalFrame& frame) |
19 : MediaValuesDynamic(&frame) {} | 20 : MediaValuesDynamic(&frame) {} |
20 | 21 |
21 double MediaValuesInitialViewport::viewportWidth() const { | 22 double MediaValuesInitialViewport::viewportWidth() const { |
22 DCHECK(m_frame->view()); | 23 DCHECK(m_frame->view()); |
23 return m_frame->view()->initialViewportWidth(); | 24 return m_frame->view()->initialViewportWidth(); |
24 } | 25 } |
25 | 26 |
26 double MediaValuesInitialViewport::viewportHeight() const { | 27 double MediaValuesInitialViewport::viewportHeight() const { |
27 DCHECK(m_frame->view()); | 28 DCHECK(m_frame->view()); |
28 return m_frame->view()->initialViewportHeight(); | 29 return m_frame->view()->initialViewportHeight(); |
29 } | 30 } |
30 | 31 |
31 } // namespace blink | 32 } // namespace blink |
OLD | NEW |