OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All R
ights Reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All R
ights Reserved. |
3 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) | 3 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 if (defers == m_defersLoading) | 297 if (defers == m_defersLoading) |
298 return; | 298 return; |
299 | 299 |
300 m_defersLoading = defers; | 300 m_defersLoading = defers; |
301 for (Frame* frame = mainFrame(); frame; frame = frame->tree().traverseNext()
) { | 301 for (Frame* frame = mainFrame(); frame; frame = frame->tree().traverseNext()
) { |
302 if (frame->isLocalFrame()) | 302 if (frame->isLocalFrame()) |
303 toLocalFrame(frame)->loader().setDefersLoading(defers); | 303 toLocalFrame(frame)->loader().setDefersLoading(defers); |
304 } | 304 } |
305 } | 305 } |
306 | 306 |
307 void Page::setPageScaleFactor(float scale, const IntPoint& origin) | 307 void Page::setPageScaleFactor(float scale) |
308 { | 308 { |
309 if (!mainFrame()->isLocalFrame()) | 309 frameHost().visualViewport().setScale(scale); |
310 return; | |
311 | |
312 FrameView* view = deprecatedLocalMainFrame()->view(); | |
313 ScrollableArea* layoutViewport = view ? view->layoutViewportScrollableArea()
: nullptr; | |
314 VisualViewport& visualViewport = frameHost().visualViewport(); | |
315 | |
316 if (scale != visualViewport.scale()) { | |
317 visualViewport.setScale(scale); | |
318 | |
319 chromeClient().pageScaleFactorChanged(); | |
320 | |
321 deprecatedLocalMainFrame()->loader().saveScrollState(); | |
322 } | |
323 | |
324 if (layoutViewport && layoutViewport->scrollPosition() != origin) | |
325 layoutViewport->setScrollPosition(origin, ProgrammaticScroll); | |
326 } | 310 } |
327 | 311 |
328 float Page::pageScaleFactor() const | 312 float Page::pageScaleFactor() const |
329 { | 313 { |
330 return frameHost().visualViewport().scale(); | 314 return frameHost().visualViewport().scale(); |
331 } | 315 } |
332 | 316 |
333 void Page::setDeviceScaleFactor(float scaleFactor) | 317 void Page::setDeviceScaleFactor(float scaleFactor) |
334 { | 318 { |
335 if (m_deviceScaleFactor == scaleFactor) | 319 if (m_deviceScaleFactor == scaleFactor) |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
609 { | 593 { |
610 } | 594 } |
611 | 595 |
612 Page::PageClients::~PageClients() | 596 Page::PageClients::~PageClients() |
613 { | 597 { |
614 } | 598 } |
615 | 599 |
616 template class CORE_TEMPLATE_EXPORT WillBeHeapSupplement<Page>; | 600 template class CORE_TEMPLATE_EXPORT WillBeHeapSupplement<Page>; |
617 | 601 |
618 } // namespace blink | 602 } // namespace blink |
OLD | NEW |