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

Side by Side Diff: third_party/WebKit/Source/core/frame/LocalFrame.cpp

Issue 2730573003: Moved FrameHost::m_visualViewport to Page (Closed)
Patch Set: Fixed some compile errors on mac and android Created 3 years, 9 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
1 /* 1 /*
2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
3 * 1999 Lars Knoll <knoll@kde.org> 3 * 1999 Lars Knoll <knoll@kde.org>
4 * 1999 Antti Koivisto <koivisto@kde.org> 4 * 1999 Antti Koivisto <koivisto@kde.org>
5 * 2000 Simon Hausmann <hausmann@kde.org> 5 * 2000 Simon Hausmann <hausmann@kde.org>
6 * 2000 Stefan Schimanski <1Stein@gmx.de> 6 * 2000 Stefan Schimanski <1Stein@gmx.de>
7 * 2001 George Staikos <staikos@kde.org> 7 * 2001 George Staikos <staikos@kde.org>
8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All 8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All
9 * rights reserved. 9 * rights reserved.
10 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com> 10 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com>
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 class DragImageBuilder { 114 class DragImageBuilder {
115 STACK_ALLOCATED(); 115 STACK_ALLOCATED();
116 116
117 public: 117 public:
118 DragImageBuilder(const LocalFrame& localFrame, const FloatRect& bounds) 118 DragImageBuilder(const LocalFrame& localFrame, const FloatRect& bounds)
119 : m_localFrame(&localFrame), m_bounds(bounds) { 119 : m_localFrame(&localFrame), m_bounds(bounds) {
120 // TODO(oshima): Remove this when all platforms are migrated to 120 // TODO(oshima): Remove this when all platforms are migrated to
121 // use-zoom-for-dsf. 121 // use-zoom-for-dsf.
122 float deviceScaleFactor = 122 float deviceScaleFactor =
123 m_localFrame->page()->deviceScaleFactorDeprecated(); 123 m_localFrame->page()->deviceScaleFactorDeprecated();
124 float pageScaleFactor = m_localFrame->host()->visualViewport().scale(); 124 float pageScaleFactor = m_localFrame->page()->visualViewport().scale();
125 m_bounds.setWidth(m_bounds.width() * deviceScaleFactor * pageScaleFactor); 125 m_bounds.setWidth(m_bounds.width() * deviceScaleFactor * pageScaleFactor);
126 m_bounds.setHeight(m_bounds.height() * deviceScaleFactor * pageScaleFactor); 126 m_bounds.setHeight(m_bounds.height() * deviceScaleFactor * pageScaleFactor);
127 m_builder = WTF::wrapUnique(new PaintRecordBuilder( 127 m_builder = WTF::wrapUnique(new PaintRecordBuilder(
128 SkRect::MakeIWH(m_bounds.width(), m_bounds.height()))); 128 SkRect::MakeIWH(m_bounds.width(), m_bounds.height())));
129 129
130 AffineTransform transform; 130 AffineTransform transform;
131 transform.scale(deviceScaleFactor * pageScaleFactor, 131 transform.scale(deviceScaleFactor * pageScaleFactor,
132 deviceScaleFactor * pageScaleFactor); 132 deviceScaleFactor * pageScaleFactor);
133 transform.translate(-m_bounds.x(), -m_bounds.y()); 133 transform.translate(-m_bounds.x(), -m_bounds.y());
134 context().getPaintController().createAndAppend<BeginTransformDisplayItem>( 134 context().getPaintController().createAndAppend<BeginTransformDisplayItem>(
(...skipping 783 matching lines...) Expand 10 before | Expand all | Expand 10 after
918 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext()) 918 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext())
919 m_frame->client()->frameBlameContext()->Enter(); 919 m_frame->client()->frameBlameContext()->Enter();
920 } 920 }
921 921
922 ScopedFrameBlamer::~ScopedFrameBlamer() { 922 ScopedFrameBlamer::~ScopedFrameBlamer() {
923 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext()) 923 if (m_frame && m_frame->client() && m_frame->client()->frameBlameContext())
924 m_frame->client()->frameBlameContext()->Leave(); 924 m_frame->client()->frameBlameContext()->Leave();
925 } 925 }
926 926
927 } // namespace blink 927 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp ('k') | third_party/WebKit/Source/core/frame/LocalFrameTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698