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

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

Issue 2383113003: Refactor ScrollableArea::setScrollPosition. (Closed)
Patch Set: 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
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after
616 616
617 IntSize VisualViewport::contentsSize() const { 617 IntSize VisualViewport::contentsSize() const {
618 LocalFrame* frame = mainFrame(); 618 LocalFrame* frame = mainFrame();
619 619
620 if (!frame || !frame->view()) 620 if (!frame || !frame->view())
621 return IntSize(); 621 return IntSize();
622 622
623 return frame->view()->visibleContentRect(IncludeScrollbars).size(); 623 return frame->view()->visibleContentRect(IncludeScrollbars).size();
624 } 624 }
625 625
626 void VisualViewport::setScrollOffset(const DoublePoint& offset, 626 void VisualViewport::updateScrollPosition(const DoublePoint& position,
627 ScrollType scrollType) { 627 ScrollType scrollType) {
628 if (didSetScaleOrLocation(m_scale, toFloatPoint(offset)) && 628 if (didSetScaleOrLocation(m_scale, toFloatPoint(position)) &&
629 scrollType != AnchoringScroll) 629 scrollType != AnchoringScroll)
630 notifyRootFrameViewport(); 630 notifyRootFrameViewport();
631 } 631 }
632 632
633 GraphicsLayer* VisualViewport::layerForContainer() const { 633 GraphicsLayer* VisualViewport::layerForContainer() const {
634 return m_innerViewportContainerLayer.get(); 634 return m_innerViewportContainerLayer.get();
635 } 635 }
636 636
637 GraphicsLayer* VisualViewport::layerForScrolling() const { 637 GraphicsLayer* VisualViewport::layerForScrolling() const {
638 return m_innerViewportScrollLayer.get(); 638 return m_innerViewportScrollLayer.get();
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
838 } else if (graphicsLayer == m_rootTransformLayer.get()) { 838 } else if (graphicsLayer == m_rootTransformLayer.get()) {
839 name = "Root Transform Layer"; 839 name = "Root Transform Layer";
840 } else { 840 } else {
841 ASSERT_NOT_REACHED(); 841 ASSERT_NOT_REACHED();
842 } 842 }
843 843
844 return name; 844 return name;
845 } 845 }
846 846
847 } // namespace blink 847 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698