OLD | NEW |
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 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 void ScrollableArea::scrollPositionChanged(const DoublePoint& position, ScrollTy
pe scrollType) | 263 void ScrollableArea::scrollPositionChanged(const DoublePoint& position, ScrollTy
pe scrollType) |
264 { | 264 { |
265 TRACE_EVENT0("blink", "ScrollableArea::scrollPositionChanged"); | 265 TRACE_EVENT0("blink", "ScrollableArea::scrollPositionChanged"); |
266 | 266 |
267 DoublePoint oldPosition = scrollPositionDouble(); | 267 DoublePoint oldPosition = scrollPositionDouble(); |
268 DoublePoint truncatedPosition = shouldUseIntegerScrollOffset() ? flooredIntP
oint(position) : position; | 268 DoublePoint truncatedPosition = shouldUseIntegerScrollOffset() ? flooredIntP
oint(position) : position; |
269 | 269 |
270 // Tell the derived class to scroll its contents. | 270 // Tell the derived class to scroll its contents. |
271 setScrollOffset(truncatedPosition, scrollType); | 271 setScrollOffset(truncatedPosition, scrollType); |
272 | 272 |
| 273 // If the scroll position is changed, the user is not dragging (e.g panning |
| 274 // a map). |
| 275 setUserMayHaveDragged(false); |
| 276 |
273 // Tell the scrollbars to update their thumb postions. | 277 // Tell the scrollbars to update their thumb postions. |
274 // If the scrollbar does not have its own layer, it must always be | 278 // If the scrollbar does not have its own layer, it must always be |
275 // invalidated to reflect the new thumb position, even if the theme did not | 279 // invalidated to reflect the new thumb position, even if the theme did not |
276 // invalidate any individual part. | 280 // invalidate any individual part. |
277 if (Scrollbar* horizontalScrollbar = this->horizontalScrollbar()) | 281 if (Scrollbar* horizontalScrollbar = this->horizontalScrollbar()) |
278 horizontalScrollbar->offsetDidChange(); | 282 horizontalScrollbar->offsetDidChange(); |
279 if (Scrollbar* verticalScrollbar = this->verticalScrollbar()) | 283 if (Scrollbar* verticalScrollbar = this->verticalScrollbar()) |
280 verticalScrollbar->offsetDidChange(); | 284 verticalScrollbar->offsetDidChange(); |
281 | 285 |
282 if (scrollPositionDouble() != oldPosition) { | 286 if (scrollPositionDouble() != oldPosition) { |
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
613 std::max(0, size.height() - horizontalScrollbarHeight())); | 617 std::max(0, size.height() - horizontalScrollbarHeight())); |
614 } | 618 } |
615 | 619 |
616 DEFINE_TRACE(ScrollableArea) | 620 DEFINE_TRACE(ScrollableArea) |
617 { | 621 { |
618 visitor->trace(m_scrollAnimator); | 622 visitor->trace(m_scrollAnimator); |
619 visitor->trace(m_programmaticScrollAnimator); | 623 visitor->trace(m_programmaticScrollAnimator); |
620 } | 624 } |
621 | 625 |
622 } // namespace blink | 626 } // namespace blink |
OLD | NEW |