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 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
450 // to really know if the mouse has exited the scrollbar on a mouseUp. | 450 // to really know if the mouse has exited the scrollbar on a mouseUp. |
451 ScrollbarPart part = theme().hitTest(*this, mouseEvent.position()); | 451 ScrollbarPart part = theme().hitTest(*this, mouseEvent.position()); |
452 if (part == NoPart) | 452 if (part == NoPart) |
453 m_scrollableArea->mouseExitedScrollbar(*this); | 453 m_scrollableArea->mouseExitedScrollbar(*this); |
454 } | 454 } |
455 } | 455 } |
456 | 456 |
457 void Scrollbar::mouseDown(const PlatformMouseEvent& evt) | 457 void Scrollbar::mouseDown(const PlatformMouseEvent& evt) |
458 { | 458 { |
459 // Early exit for right click | 459 // Early exit for right click |
460 if (evt.button() == RightButton) | 460 if (evt.pointerProperties().button == WebPointerProperties::Button::Right) |
461 return; | 461 return; |
462 | 462 |
463 setPressedPart(theme().hitTest(*this, evt.position())); | 463 setPressedPart(theme().hitTest(*this, evt.position())); |
464 int pressedPos = orientation() == HorizontalScrollbar ? convertFromRootFrame
(evt.position()).x() : convertFromRootFrame(evt.position()).y(); | 464 int pressedPos = orientation() == HorizontalScrollbar ? convertFromRootFrame
(evt.position()).x() : convertFromRootFrame(evt.position()).y(); |
465 | 465 |
466 if ((m_pressedPart == BackTrackPart || m_pressedPart == ForwardTrackPart) &&
theme().shouldCenterOnThumb(*this, evt)) { | 466 if ((m_pressedPart == BackTrackPart || m_pressedPart == ForwardTrackPart) &&
theme().shouldCenterOnThumb(*this, evt)) { |
467 setHoveredPart(ThumbPart); | 467 setHoveredPart(ThumbPart); |
468 setPressedPart(ThumbPart); | 468 setPressedPart(ThumbPart); |
469 m_dragOrigin = m_currentPos; | 469 m_dragOrigin = m_currentPos; |
470 int thumbLen = theme().thumbLength(*this); | 470 int thumbLen = theme().thumbLength(*this); |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
590 invalidParts = AllParts; | 590 invalidParts = AllParts; |
591 if (invalidParts & ~ThumbPart) | 591 if (invalidParts & ~ThumbPart) |
592 m_trackNeedsRepaint = true; | 592 m_trackNeedsRepaint = true; |
593 if (invalidParts & ThumbPart) | 593 if (invalidParts & ThumbPart) |
594 m_thumbNeedsRepaint = true; | 594 m_thumbNeedsRepaint = true; |
595 if (m_scrollableArea) | 595 if (m_scrollableArea) |
596 m_scrollableArea->setScrollbarNeedsPaintInvalidation(orientation()); | 596 m_scrollableArea->setScrollbarNeedsPaintInvalidation(orientation()); |
597 } | 597 } |
598 | 598 |
599 } // namespace blink | 599 } // namespace blink |
OLD | NEW |