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

Side by Side Diff: third_party/WebKit/Source/core/page/scrolling/RootScrollerController.cpp

Issue 2128543002: Make ViewportScrollCallback an interface and add child and root classes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@moveViewportCreationToDocumentAttachment
Patch Set: Created 4 years, 5 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 // Copyright 2016 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/page/scrolling/RootScrollerController.h" 5 #include "core/page/scrolling/RootScrollerController.h"
6 6
7 #include "core/dom/Document.h" 7 #include "core/dom/Document.h"
8 #include "core/dom/Element.h" 8 #include "core/dom/Element.h"
9 #include "core/frame/FrameHost.h" 9 #include "core/frame/FrameHost.h"
10 #include "core/frame/FrameView.h" 10 #include "core/frame/FrameView.h"
11 #include "core/frame/TopControls.h" 11 #include "core/frame/TopControls.h"
12 #include "core/layout/LayoutBox.h" 12 #include "core/layout/LayoutBox.h"
13 #include "core/page/Page.h" 13 #include "core/page/Page.h"
14 #include "core/page/scrolling/OverscrollController.h" 14 #include "core/page/scrolling/OverscrollController.h"
15 #include "core/page/scrolling/ViewportScrollCallback.h" 15 #include "core/page/scrolling/RootViewportScrollCallback.h"
tdresser 2016/07/06 18:28:18 Is this used?
bokan 2016/07/06 21:12:04 Nope, this is a leftover from coding, it should re
16 #include "core/paint/PaintLayerScrollableArea.h" 16 #include "core/paint/PaintLayerScrollableArea.h"
17 #include "platform/scroll/ScrollableArea.h" 17 #include "platform/scroll/ScrollableArea.h"
18 18
19 namespace blink { 19 namespace blink {
20 20
21 namespace { 21 namespace {
22 22
23 ScrollableArea* scrollableAreaFor(const Element& element) 23 ScrollableArea* scrollableAreaFor(const Element& element)
24 { 24 {
25 if (!element.layoutObject() || !element.layoutObject()->isBox()) 25 if (!element.layoutObject() || !element.layoutObject()->isBox())
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 return false; 66 return false;
67 67
68 if (!fillsViewport(element)) 68 if (!fillsViewport(element))
69 return false; 69 return false;
70 70
71 return true; 71 return true;
72 } 72 }
73 73
74 } // namespace 74 } // namespace
75 75
76 ViewportScrollCallback* RootScrollerController::createViewportApplyScroll(
77 TopControls* topControls, OverscrollController* overscrollController)
78 {
79 return new ViewportScrollCallback(topControls, overscrollController);
80 }
81
82 RootScrollerController::RootScrollerController(Document& document, ViewportScrol lCallback* applyScrollCallback) 76 RootScrollerController::RootScrollerController(Document& document, ViewportScrol lCallback* applyScrollCallback)
83 : m_document(&document) 77 : m_document(&document)
84 , m_viewportApplyScroll(applyScrollCallback) 78 , m_viewportApplyScroll(applyScrollCallback)
85 { 79 {
86 } 80 }
87 81
88 DEFINE_TRACE(RootScrollerController) 82 DEFINE_TRACE(RootScrollerController)
89 { 83 {
90 visitor->trace(m_document); 84 visitor->trace(m_document);
91 visitor->trace(m_viewportApplyScroll); 85 visitor->trace(m_viewportApplyScroll);
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 m_viewportApplyScroll->setScroller(targetScroller); 150 m_viewportApplyScroll->setScroller(targetScroller);
157 } 151 }
158 152
159 Element* RootScrollerController::defaultEffectiveRootScroller() 153 Element* RootScrollerController::defaultEffectiveRootScroller()
160 { 154 {
161 DCHECK(m_document); 155 DCHECK(m_document);
162 return m_document->documentElement(); 156 return m_document->documentElement();
163 } 157 }
164 158
165 } // namespace blink 159 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698