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 12 matching lines...) Expand all Loading... |
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
24 */ | 24 */ |
25 | 25 |
26 #include "config.h" | 26 #include "config.h" |
27 #include "platform/scroll/Scrollbar.h" | 27 #include "platform/scroll/Scrollbar.h" |
28 | 28 |
29 #include <algorithm> | 29 #include <algorithm> |
30 #include "platform/PlatformGestureEvent.h" | 30 #include "platform/PlatformGestureEvent.h" |
31 #include "platform/PlatformMouseEvent.h" | 31 #include "platform/PlatformMouseEvent.h" |
32 #include "platform/graphics/paint/CullRect.h" | 32 #include "platform/graphics/paint/CullRect.h" |
| 33 // See windowActiveChangedForSnowLeopardOnly() below. |
| 34 // TODO(ellyjones): remove this when Snow Leopard support is gone. |
| 35 #if OS(MACOSX) |
| 36 #include "platform/mac/VersionUtilMac.h" |
| 37 #endif |
33 #include "platform/scroll/ScrollAnimatorBase.h" | 38 #include "platform/scroll/ScrollAnimatorBase.h" |
34 #include "platform/scroll/ScrollableArea.h" | 39 #include "platform/scroll/ScrollableArea.h" |
35 #include "platform/scroll/ScrollbarTheme.h" | 40 #include "platform/scroll/ScrollbarTheme.h" |
36 | 41 |
37 namespace blink { | 42 namespace blink { |
38 | 43 |
39 PassRefPtrWillBeRawPtr<Scrollbar> Scrollbar::create(ScrollableArea* scrollableAr
ea, ScrollbarOrientation orientation, ScrollbarControlSize size) | 44 PassRefPtrWillBeRawPtr<Scrollbar> Scrollbar::create(ScrollableArea* scrollableAr
ea, ScrollbarOrientation orientation, ScrollbarControlSize size) |
40 { | 45 { |
41 return adoptRefWillBeNoop(new Scrollbar(scrollableArea, orientation, size)); | 46 return adoptRefWillBeNoop(new Scrollbar(scrollableArea, orientation, size)); |
42 } | 47 } |
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
486 } | 491 } |
487 | 492 |
488 bool Scrollbar::shouldParticipateInHitTesting() | 493 bool Scrollbar::shouldParticipateInHitTesting() |
489 { | 494 { |
490 // Non-overlay scrollbars should always participate in hit testing. | 495 // Non-overlay scrollbars should always participate in hit testing. |
491 if (!isOverlayScrollbar()) | 496 if (!isOverlayScrollbar()) |
492 return true; | 497 return true; |
493 return m_scrollableArea->scrollAnimator()->shouldScrollbarParticipateInHitTe
sting(this); | 498 return m_scrollableArea->scrollAnimator()->shouldScrollbarParticipateInHitTe
sting(this); |
494 } | 499 } |
495 | 500 |
| 501 // Don't use this method. It will be removed later. |
| 502 // TODO(ellyjones): remove this method after Snow Leopard support drops. |
| 503 void Scrollbar::windowActiveChangedForSnowLeopardOnly() |
| 504 { |
| 505 #if OS(MACOSX) |
| 506 // On Snow Leopard, scrollbars need to be invalidated when the window |
| 507 // activity changes so that they take on the "inactive" scrollbar |
| 508 // appearance. Later OS X releases do not have such an appearance. |
| 509 if (m_theme && m_theme->invalidateOnWindowActiveChange()) { |
| 510 ASSERT(IsOSSnowLeopard()); |
| 511 invalidate(); |
| 512 } |
| 513 #endif |
| 514 } |
| 515 |
496 bool Scrollbar::isWindowActive() const | 516 bool Scrollbar::isWindowActive() const |
497 { | 517 { |
498 return m_scrollableArea && m_scrollableArea->isActive(); | 518 return m_scrollableArea && m_scrollableArea->isActive(); |
499 } | 519 } |
500 | 520 |
501 IntRect Scrollbar::convertToContainingView(const IntRect& localRect) const | 521 IntRect Scrollbar::convertToContainingView(const IntRect& localRect) const |
502 { | 522 { |
503 if (m_scrollableArea) | 523 if (m_scrollableArea) |
504 return m_scrollableArea->convertFromScrollbarToContainingView(this, loca
lRect); | 524 return m_scrollableArea->convertFromScrollbarToContainingView(this, loca
lRect); |
505 | 525 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
545 { | 565 { |
546 if (m_theme->shouldRepaintAllPartsOnInvalidation()) { | 566 if (m_theme->shouldRepaintAllPartsOnInvalidation()) { |
547 m_trackNeedsRepaint = true; | 567 m_trackNeedsRepaint = true; |
548 m_thumbNeedsRepaint = true; | 568 m_thumbNeedsRepaint = true; |
549 } | 569 } |
550 if (m_scrollableArea) | 570 if (m_scrollableArea) |
551 m_scrollableArea->setScrollbarNeedsPaintInvalidation(this); | 571 m_scrollableArea->setScrollbarNeedsPaintInvalidation(this); |
552 } | 572 } |
553 | 573 |
554 } // namespace blink | 574 } // namespace blink |
OLD | NEW |