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

Side by Side Diff: Source/platform/scroll/ScrollableArea.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/platform/scroll/ScrollableArea.h ('k') | Source/platform/scroll/Scrollbar.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 /* 1 /*
2 * Copyright (c) 2010, Google Inc. All rights reserved. 2 * Copyright (c) 2010, Google Inc. All rights reserved.
3 * Copyright (C) 2008, 2011 Apple Inc. All Rights Reserved. 3 * Copyright (C) 2008, 2011 Apple Inc. All Rights Reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 m_scrollOrigin = origin; 115 m_scrollOrigin = origin;
116 m_scrollOriginChanged = true; 116 m_scrollOriginChanged = true;
117 } 117 }
118 } 118 }
119 119
120 GraphicsLayer* ScrollableArea::layerForContainer() const 120 GraphicsLayer* ScrollableArea::layerForContainer() const
121 { 121 {
122 return layerForScrolling() ? layerForScrolling()->parent() : 0; 122 return layerForScrolling() ? layerForScrolling()->parent() : 0;
123 } 123 }
124 124
125 bool ScrollableArea::scroll(ScrollDirection direction, ScrollGranularity granula rity, float delta) 125 bool ScrollableArea::scroll(ScrollDirectionPhysical direction, ScrollGranularity granularity, float delta)
126 { 126 {
127 ASSERT(!isLogical(direction));
128
129 ScrollbarOrientation orientation; 127 ScrollbarOrientation orientation;
130 if (direction == ScrollUp || direction == ScrollDown) 128 if (direction == ScrollUp || direction == ScrollDown)
131 orientation = VerticalScrollbar; 129 orientation = VerticalScrollbar;
132 else 130 else
133 orientation = HorizontalScrollbar; 131 orientation = HorizontalScrollbar;
134 132
135 if (!userInputScrollable(orientation)) 133 if (!userInputScrollable(orientation))
136 return false; 134 return false;
137 135
138 cancelProgrammaticScrollAnimation(); 136 cancelProgrammaticScrollAnimation();
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after
582 { 580 {
583 return scrollSize(orientation); 581 return scrollSize(orientation);
584 } 582 }
585 583
586 float ScrollableArea::pixelStep(ScrollbarOrientation) const 584 float ScrollableArea::pixelStep(ScrollbarOrientation) const
587 { 585 {
588 return 1; 586 return 1;
589 } 587 }
590 588
591 } // namespace blink 589 } // namespace blink
OLDNEW
« no previous file with comments | « Source/platform/scroll/ScrollableArea.h ('k') | Source/platform/scroll/Scrollbar.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698