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

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

Issue 1147283002: Add ScrollDirectionPhysical enum in Scroll types. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed a conflict on EventHandler Created 5 years, 7 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
« no previous file with comments | « Source/core/frame/RootFrameViewport.h ('k') | Source/core/layout/LayoutBox.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « Source/core/frame/RootFrameViewport.h ('k') | Source/core/layout/LayoutBox.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698