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

Side by Side Diff: Source/core/page/AutoscrollController.cpp

Issue 899163003: Move rendering/RenderObject to layout/LayoutObject. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/page/AutoscrollController.h ('k') | Source/core/page/DragController.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv ed. 3 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv ed.
4 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) 4 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org)
5 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies) 5 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies)
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 bool AutoscrollController::autoscrollInProgress() const 60 bool AutoscrollController::autoscrollInProgress() const
61 { 61 {
62 return m_autoscrollType == AutoscrollForSelection; 62 return m_autoscrollType == AutoscrollForSelection;
63 } 63 }
64 64
65 bool AutoscrollController::autoscrollInProgress(const RenderBox* renderer) const 65 bool AutoscrollController::autoscrollInProgress(const RenderBox* renderer) const
66 { 66 {
67 return m_autoscrollRenderer == renderer; 67 return m_autoscrollRenderer == renderer;
68 } 68 }
69 69
70 void AutoscrollController::startAutoscrollForSelection(RenderObject* renderer) 70 void AutoscrollController::startAutoscrollForSelection(LayoutObject* renderer)
71 { 71 {
72 // We don't want to trigger the autoscroll or the panScroll if it's already active 72 // We don't want to trigger the autoscroll or the panScroll if it's already active
73 if (m_autoscrollType != NoAutoscroll) 73 if (m_autoscrollType != NoAutoscroll)
74 return; 74 return;
75 RenderBox* scrollable = RenderBox::findAutoscrollable(renderer); 75 RenderBox* scrollable = RenderBox::findAutoscrollable(renderer);
76 if (!scrollable) 76 if (!scrollable)
77 scrollable = renderer->isListBox() ? toRenderListBox(renderer) : nullptr ; 77 scrollable = renderer->isListBox() ? toRenderListBox(renderer) : nullptr ;
78 if (!scrollable) 78 if (!scrollable)
79 return; 79 return;
80 m_autoscrollType = AutoscrollForSelection; 80 m_autoscrollType = AutoscrollForSelection;
(...skipping 15 matching lines...) Expand all
96 if (FrameView* view = scrollable->frame()->view()) { 96 if (FrameView* view = scrollable->frame()->view()) {
97 view->removePanScrollIcon(); 97 view->removePanScrollIcon();
98 view->setCursor(pointerCursor()); 98 view->setCursor(pointerCursor());
99 } 99 }
100 } 100 }
101 #endif 101 #endif
102 102
103 m_autoscrollType = NoAutoscroll; 103 m_autoscrollType = NoAutoscroll;
104 } 104 }
105 105
106 void AutoscrollController::stopAutoscrollIfNeeded(RenderObject* renderer) 106 void AutoscrollController::stopAutoscrollIfNeeded(LayoutObject* renderer)
107 { 107 {
108 if (m_autoscrollRenderer != renderer) 108 if (m_autoscrollRenderer != renderer)
109 return; 109 return;
110 m_autoscrollRenderer = nullptr; 110 m_autoscrollRenderer = nullptr;
111 m_autoscrollType = NoAutoscroll; 111 m_autoscrollType = NoAutoscroll;
112 } 112 }
113 113
114 void AutoscrollController::updateAutoscrollRenderer() 114 void AutoscrollController::updateAutoscrollRenderer()
115 { 115 {
116 if (!m_autoscrollRenderer) 116 if (!m_autoscrollRenderer)
117 return; 117 return;
118 118
119 RenderObject* renderer = m_autoscrollRenderer; 119 LayoutObject* renderer = m_autoscrollRenderer;
120 120
121 #if OS(WIN) 121 #if OS(WIN)
122 HitTestResult hitTest = renderer->frame()->eventHandler().hitTestResultAtPoi nt(m_panScrollStartPos, HitTestRequest::ReadOnly | HitTestRequest::Active); 122 HitTestResult hitTest = renderer->frame()->eventHandler().hitTestResultAtPoi nt(m_panScrollStartPos, HitTestRequest::ReadOnly | HitTestRequest::Active);
123 123
124 if (Node* nodeAtPoint = hitTest.innerNode()) 124 if (Node* nodeAtPoint = hitTest.innerNode())
125 renderer = nodeAtPoint->renderer(); 125 renderer = nodeAtPoint->renderer();
126 #endif 126 #endif
127 127
128 while (renderer && !(renderer->isBox() && toRenderBox(renderer)->canAutoscro ll())) 128 while (renderer && !(renderer->isBox() && toRenderBox(renderer)->canAutoscro ll()))
129 renderer = renderer->parent(); 129 renderer = renderer->parent();
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 } else if (east) 290 } else if (east)
291 view->setCursor(eastPanningCursor()); 291 view->setCursor(eastPanningCursor());
292 else if (west) 292 else if (west)
293 view->setCursor(westPanningCursor()); 293 view->setCursor(westPanningCursor());
294 else 294 else
295 view->setCursor(middlePanningCursor()); 295 view->setCursor(middlePanningCursor());
296 } 296 }
297 #endif 297 #endif
298 298
299 } // namespace blink 299 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/page/AutoscrollController.h ('k') | Source/core/page/DragController.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698