Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: third_party/WebKit/Source/core/css/MediaValuesInitialViewport.cpp

Issue 2414343002: Implement MediaValues for initial viewport. (Closed)
Patch Set: CORE_EXPORT in inheritance chain for Windows Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "core/css/MediaValuesInitialViewport.h"
6
7 #include "core/dom/Document.h"
8 #include "core/frame/FrameView.h"
9 #include "core/frame/LocalFrame.h"
10 #include "core/layout/api/LayoutViewItem.h"
11
12 namespace blink {
13
14 MediaValues* MediaValuesInitialViewport::create(LocalFrame& frame) {
15 return new MediaValuesInitialViewport(frame);
16 }
17
18 MediaValuesInitialViewport::MediaValuesInitialViewport(LocalFrame& frame)
19 : MediaValuesDynamic(&frame) {}
20
21 double MediaValuesInitialViewport::viewportWidth() const {
22 DCHECK(m_frame->view() && m_frame->document());
23 int viewportWidth = m_frame->view()->frameRect().width();
24 return adjustDoubleForAbsoluteZoom(
25 viewportWidth, m_frame->document()->layoutViewItem().styleRef());
26 }
27
28 double MediaValuesInitialViewport::viewportHeight() const {
29 DCHECK(m_frame->view() && m_frame->document());
30 int viewportHeight = m_frame->view()->frameRect().height();
31 return adjustDoubleForAbsoluteZoom(
32 viewportHeight, m_frame->document()->layoutViewItem().styleRef());
33 }
34
35 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698