| 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 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 return; | 219 return; |
| 220 | 220 |
| 221 // Handle the track. | 221 // Handle the track. |
| 222 if ((m_pressedPart == BackTrackPart || m_pressedPart == ForwardTrackPart) &&
thumbUnderMouse(this)) { | 222 if ((m_pressedPart == BackTrackPart || m_pressedPart == ForwardTrackPart) &&
thumbUnderMouse(this)) { |
| 223 theme()->invalidatePart(this, m_pressedPart); | 223 theme()->invalidatePart(this, m_pressedPart); |
| 224 setHoveredPart(ThumbPart); | 224 setHoveredPart(ThumbPart); |
| 225 return; | 225 return; |
| 226 } | 226 } |
| 227 | 227 |
| 228 // Handle the arrows and track. | 228 // Handle the arrows and track. |
| 229 if (m_scrollableArea && m_scrollableArea->userScroll(pressedPartScrollDirect
ionPhysical(), pressedPartScrollGranularity())) | 229 if (m_scrollableArea && m_scrollableArea->userScroll(pressedPartScrollDirect
ionPhysical(), pressedPartScrollGranularity()).didScroll) |
| 230 startTimerIfNeeded(delay); | 230 startTimerIfNeeded(delay); |
| 231 } | 231 } |
| 232 | 232 |
| 233 void Scrollbar::startTimerIfNeeded(double delay) | 233 void Scrollbar::startTimerIfNeeded(double delay) |
| 234 { | 234 { |
| 235 // Don't do anything for the thumb. | 235 // Don't do anything for the thumb. |
| 236 if (m_pressedPart == ThumbPart) | 236 if (m_pressedPart == ThumbPart) |
| 237 return; | 237 return; |
| 238 | 238 |
| 239 // Handle the track. We halt track scrolling once the thumb is level | 239 // 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... |
| 370 return true; | 370 return true; |
| 371 case PlatformEvent::GestureScrollEnd: | 371 case PlatformEvent::GestureScrollEnd: |
| 372 case PlatformEvent::GestureLongPress: | 372 case PlatformEvent::GestureLongPress: |
| 373 case PlatformEvent::GestureFlingStart: | 373 case PlatformEvent::GestureFlingStart: |
| 374 m_scrollPos = 0; | 374 m_scrollPos = 0; |
| 375 m_pressedPos = 0; | 375 m_pressedPos = 0; |
| 376 setPressedPart(NoPart); | 376 setPressedPart(NoPart); |
| 377 return false; | 377 return false; |
| 378 case PlatformEvent::GestureTap: { | 378 case PlatformEvent::GestureTap: { |
| 379 if (m_pressedPart != ThumbPart && m_pressedPart != NoPart && m_scrollabl
eArea | 379 if (m_pressedPart != ThumbPart && m_pressedPart != NoPart && m_scrollabl
eArea |
| 380 && m_scrollableArea->userScroll(pressedPartScrollDirectionPhysical()
, pressedPartScrollGranularity())) { | 380 && m_scrollableArea->userScroll(pressedPartScrollDirectionPhysical()
, pressedPartScrollGranularity()).didScroll) { |
| 381 return true; | 381 return true; |
| 382 } | 382 } |
| 383 m_scrollPos = 0; | 383 m_scrollPos = 0; |
| 384 m_pressedPos = 0; | 384 m_pressedPos = 0; |
| 385 setPressedPart(NoPart); | 385 setPressedPart(NoPart); |
| 386 return false; | 386 return false; |
| 387 } | 387 } |
| 388 default: | 388 default: |
| 389 // By default, we assume that gestures don't deselect the scrollbar. | 389 // By default, we assume that gestures don't deselect the scrollbar. |
| 390 return true; | 390 return true; |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 560 if (!m_scrollableArea) | 560 if (!m_scrollableArea) |
| 561 return 0; | 561 return 0; |
| 562 | 562 |
| 563 if (m_orientation == HorizontalScrollbar) | 563 if (m_orientation == HorizontalScrollbar) |
| 564 return m_scrollableArea->scrollPosition().x() - m_scrollableArea->minimu
mScrollPosition().x(); | 564 return m_scrollableArea->scrollPosition().x() - m_scrollableArea->minimu
mScrollPosition().x(); |
| 565 | 565 |
| 566 return m_scrollableArea->scrollPosition().y() - m_scrollableArea->minimumScr
ollPosition().y(); | 566 return m_scrollableArea->scrollPosition().y() - m_scrollableArea->minimumScr
ollPosition().y(); |
| 567 } | 567 } |
| 568 | 568 |
| 569 } // namespace blink | 569 } // namespace blink |
| OLD | NEW |