| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2006, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2004, 2006, 2008 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 if (m_pressedPart == ThumbPart || m_pressedPart == NoPart) | 195 if (m_pressedPart == ThumbPart || m_pressedPart == NoPart) |
| 196 return; | 196 return; |
| 197 | 197 |
| 198 // Handle the track. | 198 // Handle the track. |
| 199 if ((m_pressedPart == BackTrackPart || m_pressedPart == ForwardTrackPart) &&
thumbWillBeUnderMouse()) { | 199 if ((m_pressedPart == BackTrackPart || m_pressedPart == ForwardTrackPart) &&
thumbWillBeUnderMouse()) { |
| 200 setHoveredPart(ThumbPart); | 200 setHoveredPart(ThumbPart); |
| 201 return; | 201 return; |
| 202 } | 202 } |
| 203 | 203 |
| 204 // Handle the arrows and track. | 204 // Handle the arrows and track. |
| 205 if (m_scrollableArea && m_scrollableArea->userScroll(pressedPartScrollDirect
ionPhysical(), pressedPartScrollGranularity()).didScroll) | 205 if (m_scrollableArea && m_scrollableArea->userScroll(pressedPartScrollGranul
arity(), toScrollDelta(pressedPartScrollDirectionPhysical(), 1)).didScroll()) |
| 206 startTimerIfNeeded(delay); | 206 startTimerIfNeeded(delay); |
| 207 } | 207 } |
| 208 | 208 |
| 209 void Scrollbar::startTimerIfNeeded(double delay) | 209 void Scrollbar::startTimerIfNeeded(double delay) |
| 210 { | 210 { |
| 211 // Don't do anything for the thumb. | 211 // Don't do anything for the thumb. |
| 212 if (m_pressedPart == ThumbPart) | 212 if (m_pressedPart == ThumbPart) |
| 213 return; | 213 return; |
| 214 | 214 |
| 215 // Handle the track. We halt track scrolling once the thumb is level | 215 // Handle the track. We halt track scrolling once the thumb is level |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 346 return true; | 346 return true; |
| 347 case PlatformEvent::GestureScrollEnd: | 347 case PlatformEvent::GestureScrollEnd: |
| 348 case PlatformEvent::GestureLongPress: | 348 case PlatformEvent::GestureLongPress: |
| 349 case PlatformEvent::GestureFlingStart: | 349 case PlatformEvent::GestureFlingStart: |
| 350 m_scrollPos = 0; | 350 m_scrollPos = 0; |
| 351 m_pressedPos = 0; | 351 m_pressedPos = 0; |
| 352 setPressedPart(NoPart); | 352 setPressedPart(NoPart); |
| 353 return false; | 353 return false; |
| 354 case PlatformEvent::GestureTap: { | 354 case PlatformEvent::GestureTap: { |
| 355 if (m_pressedPart != ThumbPart && m_pressedPart != NoPart && m_scrollabl
eArea | 355 if (m_pressedPart != ThumbPart && m_pressedPart != NoPart && m_scrollabl
eArea |
| 356 && m_scrollableArea->userScroll(pressedPartScrollDirectionPhysical()
, pressedPartScrollGranularity()).didScroll) { | 356 && m_scrollableArea->userScroll(pressedPartScrollGranularity(), toSc
rollDelta(pressedPartScrollDirectionPhysical(), 1)).didScroll()) { |
| 357 return true; | 357 return true; |
| 358 } | 358 } |
| 359 m_scrollPos = 0; | 359 m_scrollPos = 0; |
| 360 m_pressedPos = 0; | 360 m_pressedPos = 0; |
| 361 setPressedPart(NoPart); | 361 setPressedPart(NoPart); |
| 362 return false; | 362 return false; |
| 363 } | 363 } |
| 364 default: | 364 default: |
| 365 // By default, we assume that gestures don't deselect the scrollbar. | 365 // By default, we assume that gestures don't deselect the scrollbar. |
| 366 return true; | 366 return true; |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 580 invalidParts = AllParts; | 580 invalidParts = AllParts; |
| 581 if (invalidParts & ~ThumbPart) | 581 if (invalidParts & ~ThumbPart) |
| 582 m_trackNeedsRepaint = true; | 582 m_trackNeedsRepaint = true; |
| 583 if (invalidParts & ThumbPart) | 583 if (invalidParts & ThumbPart) |
| 584 m_thumbNeedsRepaint = true; | 584 m_thumbNeedsRepaint = true; |
| 585 if (m_scrollableArea) | 585 if (m_scrollableArea) |
| 586 m_scrollableArea->setScrollbarNeedsPaintInvalidation(orientation()); | 586 m_scrollableArea->setScrollbarNeedsPaintInvalidation(orientation()); |
| 587 } | 587 } |
| 588 | 588 |
| 589 } // namespace blink | 589 } // namespace blink |
| OLD | NEW |