Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(77)

Side by Side Diff: third_party/WebKit/Source/platform/scroll/Scrollbar.cpp

Issue 1849343003: mac: Remove IsOSSnowLeopard(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/platform/scroll/Scrollbar.h ('k') | third_party/apple_apsl/CFBase.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 13 matching lines...) Expand all
24 */ 24 */
25 25
26 #include "platform/scroll/Scrollbar.h" 26 #include "platform/scroll/Scrollbar.h"
27 27
28 #include <algorithm> 28 #include <algorithm>
29 #include "platform/HostWindow.h" 29 #include "platform/HostWindow.h"
30 #include "platform/PlatformGestureEvent.h" 30 #include "platform/PlatformGestureEvent.h"
31 #include "platform/PlatformMouseEvent.h" 31 #include "platform/PlatformMouseEvent.h"
32 #include "platform/geometry/FloatRect.h" 32 #include "platform/geometry/FloatRect.h"
33 #include "platform/graphics/paint/CullRect.h" 33 #include "platform/graphics/paint/CullRect.h"
34 // See windowActiveChangedForSnowLeopardOnly() below.
35 // TODO(ellyjones): remove this when Snow Leopard support is gone.
36 #if OS(MACOSX)
37 #include "platform/mac/VersionUtilMac.h"
38 #endif
39 #include "platform/scroll/ScrollAnimatorBase.h" 34 #include "platform/scroll/ScrollAnimatorBase.h"
40 #include "platform/scroll/ScrollableArea.h" 35 #include "platform/scroll/ScrollableArea.h"
41 #include "platform/scroll/ScrollbarTheme.h" 36 #include "platform/scroll/ScrollbarTheme.h"
42 37
43 namespace blink { 38 namespace blink {
44 39
45 RawPtr<Scrollbar> Scrollbar::create(ScrollableArea* scrollableArea, ScrollbarOri entation orientation, ScrollbarControlSize size, HostWindow* hostWindow) 40 RawPtr<Scrollbar> Scrollbar::create(ScrollableArea* scrollableArea, ScrollbarOri entation orientation, ScrollbarControlSize size, HostWindow* hostWindow)
46 { 41 {
47 return new Scrollbar(scrollableArea, orientation, size, hostWindow); 42 return new Scrollbar(scrollableArea, orientation, size, hostWindow);
48 } 43 }
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after
528 } 523 }
529 524
530 bool Scrollbar::shouldParticipateInHitTesting() 525 bool Scrollbar::shouldParticipateInHitTesting()
531 { 526 {
532 // Non-overlay scrollbars should always participate in hit testing. 527 // Non-overlay scrollbars should always participate in hit testing.
533 if (!isOverlayScrollbar()) 528 if (!isOverlayScrollbar())
534 return true; 529 return true;
535 return m_scrollableArea->scrollAnimator().shouldScrollbarParticipateInHitTes ting(*this); 530 return m_scrollableArea->scrollAnimator().shouldScrollbarParticipateInHitTes ting(*this);
536 } 531 }
537 532
538 // Don't use this method. It will be removed later.
539 // TODO(ellyjones): remove this method after Snow Leopard support drops.
540 void Scrollbar::windowActiveChangedForSnowLeopardOnly()
541 {
542 #if OS(MACOSX)
543 // On Snow Leopard, scrollbars need to be invalidated when the window
544 // activity changes so that they take on the "inactive" scrollbar
545 // appearance. Later OS X releases do not have such an appearance.
546 if (m_theme.invalidateOnWindowActiveChange()) {
547 ASSERT(IsOSSnowLeopard());
548 invalidate();
549 }
550 #endif
551 }
552
553 bool Scrollbar::isWindowActive() const 533 bool Scrollbar::isWindowActive() const
554 { 534 {
555 return m_scrollableArea && m_scrollableArea->isActive(); 535 return m_scrollableArea && m_scrollableArea->isActive();
556 } 536 }
557 537
558 IntRect Scrollbar::convertToContainingWidget(const IntRect& localRect) const 538 IntRect Scrollbar::convertToContainingWidget(const IntRect& localRect) const
559 { 539 {
560 if (m_scrollableArea) 540 if (m_scrollableArea)
561 return m_scrollableArea->convertFromScrollbarToContainingWidget(*this, l ocalRect); 541 return m_scrollableArea->convertFromScrollbarToContainingWidget(*this, l ocalRect);
562 542
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
620 invalidParts = AllParts; 600 invalidParts = AllParts;
621 if (invalidParts & ~ThumbPart) 601 if (invalidParts & ~ThumbPart)
622 m_trackNeedsRepaint = true; 602 m_trackNeedsRepaint = true;
623 if (invalidParts & ThumbPart) 603 if (invalidParts & ThumbPart)
624 m_thumbNeedsRepaint = true; 604 m_thumbNeedsRepaint = true;
625 if (m_scrollableArea) 605 if (m_scrollableArea)
626 m_scrollableArea->setScrollbarNeedsPaintInvalidation(orientation()); 606 m_scrollableArea->setScrollbarNeedsPaintInvalidation(orientation());
627 } 607 }
628 608
629 } // namespace blink 609 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/scroll/Scrollbar.h ('k') | third_party/apple_apsl/CFBase.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698