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

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

Issue 1158673006: Replace various ScrollableArea scroll methods with setScrollPosition (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 5 years, 6 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 r ights reserved. 8 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved.
9 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com> 9 * Copyright (C) 2005 Alexey Proskuryakov <ap@nypop.com>
10 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 10 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after
513 if (document->isSVGDocument()) { 513 if (document->isSVGDocument()) {
514 if (!document->accessSVGExtensions().zoomAndPanEnabled()) 514 if (!document->accessSVGExtensions().zoomAndPanEnabled())
515 return; 515 return;
516 } 516 }
517 517
518 if (m_pageZoomFactor != pageZoomFactor) { 518 if (m_pageZoomFactor != pageZoomFactor) {
519 if (FrameView* view = this->view()) { 519 if (FrameView* view = this->view()) {
520 // Update the scroll position when doing a full page zoom, so the co ntent stays in relatively the same position. 520 // Update the scroll position when doing a full page zoom, so the co ntent stays in relatively the same position.
521 LayoutPoint scrollPosition = view->scrollPosition(); 521 LayoutPoint scrollPosition = view->scrollPosition();
522 float percentDifference = (pageZoomFactor / m_pageZoomFactor); 522 float percentDifference = (pageZoomFactor / m_pageZoomFactor);
523 view->setScrollPosition(DoublePoint(scrollPosition.x() * percentDiff erence, scrollPosition.y() * percentDifference)); 523 view->setScrollPosition(
524 DoublePoint(scrollPosition.x() * percentDifference, scrollPositi on.y() * percentDifference),
525 ProgrammaticScroll);
skobes 2015/06/04 23:35:47 Why is this a programmatic scroll? It seems conce
bokan 2015/06/05 15:15:23 I guess it could be argued either way, my view is
skobes 2015/06/05 15:53:57 It would be nice to have a comment on the ScrollTy
bokan 2015/06/05 20:35:35 Good point, I'll add it once the rest of my patche
524 } 526 }
525 } 527 }
526 528
527 m_pageZoomFactor = pageZoomFactor; 529 m_pageZoomFactor = pageZoomFactor;
528 m_textZoomFactor = textZoomFactor; 530 m_textZoomFactor = textZoomFactor;
529 531
530 for (RefPtrWillBeRawPtr<Frame> child = tree().firstChild(); child; child = c hild->tree().nextSibling()) { 532 for (RefPtrWillBeRawPtr<Frame> child = tree().firstChild(); child; child = c hild->tree().nextSibling()) {
531 if (child->isLocalFrame()) 533 if (child->isLocalFrame())
532 toLocalFrame(child.get())->setPageAndTextZoomFactors(m_pageZoomFacto r, m_textZoomFactor); 534 toLocalFrame(child.get())->setPageAndTextZoomFactors(m_pageZoomFacto r, m_textZoomFactor);
533 } 535 }
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
812 , m_textZoomFactor(parentTextZoomFactor(this)) 814 , m_textZoomFactor(parentTextZoomFactor(this))
813 , m_inViewSourceMode(false) 815 , m_inViewSourceMode(false)
814 { 816 {
815 if (isLocalRoot()) 817 if (isLocalRoot())
816 m_instrumentingAgents = InstrumentingAgents::create(); 818 m_instrumentingAgents = InstrumentingAgents::create();
817 else 819 else
818 m_instrumentingAgents = localFrameRoot()->m_instrumentingAgents; 820 m_instrumentingAgents = localFrameRoot()->m_instrumentingAgents;
819 } 821 }
820 822
821 } // namespace blink 823 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698