OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "config.h" | 5 #include "config.h" |
6 #include "core/frame/RootFrameViewport.h" | 6 #include "core/frame/RootFrameViewport.h" |
7 | 7 |
8 #include "core/frame/FrameView.h" | 8 #include "core/frame/FrameView.h" |
9 #include "core/layout/ScrollAlignment.h" | 9 #include "core/layout/ScrollAlignment.h" |
10 #include "platform/geometry/DoubleRect.h" | 10 #include "platform/geometry/DoubleRect.h" |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 GraphicsLayer* RootFrameViewport::layerForHorizontalScrollbar() const | 269 GraphicsLayer* RootFrameViewport::layerForHorizontalScrollbar() const |
270 { | 270 { |
271 return layoutViewport().layerForHorizontalScrollbar(); | 271 return layoutViewport().layerForHorizontalScrollbar(); |
272 } | 272 } |
273 | 273 |
274 GraphicsLayer* RootFrameViewport::layerForVerticalScrollbar() const | 274 GraphicsLayer* RootFrameViewport::layerForVerticalScrollbar() const |
275 { | 275 { |
276 return layoutViewport().layerForVerticalScrollbar(); | 276 return layoutViewport().layerForVerticalScrollbar(); |
277 } | 277 } |
278 | 278 |
279 bool RootFrameViewport::scroll(ScrollDirection direction, ScrollGranularity gran
ularity, float delta) | 279 bool RootFrameViewport::scroll(ScrollDirectionPhysical direction, ScrollGranular
ity granularity, float delta) |
280 { | 280 { |
281 ASSERT(!isLogical(direction)); | |
282 | |
283 updateScrollAnimator(); | 281 updateScrollAnimator(); |
284 | 282 |
285 ScrollbarOrientation orientation; | 283 ScrollbarOrientation orientation; |
286 | 284 |
287 if (direction == ScrollUp || direction == ScrollDown) | 285 if (direction == ScrollUp || direction == ScrollDown) |
288 orientation = VerticalScrollbar; | 286 orientation = VerticalScrollbar; |
289 else | 287 else |
290 orientation = HorizontalScrollbar; | 288 orientation = HorizontalScrollbar; |
291 | 289 |
292 if (layoutViewport().userInputScrollable(orientation) && visualViewport().us
erInputScrollable(orientation)) | 290 if (layoutViewport().userInputScrollable(orientation) && visualViewport().us
erInputScrollable(orientation)) |
293 return ScrollableArea::scroll(direction, granularity, delta); | 291 return ScrollableArea::scroll(direction, granularity, delta); |
294 | 292 |
295 if (visualViewport().userInputScrollable(orientation)) | 293 if (visualViewport().userInputScrollable(orientation)) |
296 return visualViewport().scroll(direction, granularity, delta); | 294 return visualViewport().scroll(direction, granularity, delta); |
297 | 295 |
298 if (layoutViewport().userInputScrollable(orientation)) | 296 if (layoutViewport().userInputScrollable(orientation)) |
299 return layoutViewport().scroll(direction, granularity, delta); | 297 return layoutViewport().scroll(direction, granularity, delta); |
300 | 298 |
301 return false; | 299 return false; |
302 } | 300 } |
303 | 301 |
304 } // namespace blink | 302 } // namespace blink |
OLD | NEW |