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

Side by Side Diff: Source/core/platform/mac/ScrollAnimatorMac.mm

Issue 21296003: Split ScrollbarThemeMac into Overlay and NonOverlay subclasses (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@composited_scrollbar_after_refactor
Patch Set: Clean up Created 7 years, 4 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2010, 2011 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 static bool globalSupportsExpansionTransitionProgress = [NSClassFromString(@ "NSScrollerImp") instancesRespondToSelector:@selector(expansionTransitionProgres s)]; 56 static bool globalSupportsExpansionTransitionProgress = [NSClassFromString(@ "NSScrollerImp") instancesRespondToSelector:@selector(expansionTransitionProgres s)];
57 return globalSupportsExpansionTransitionProgress; 57 return globalSupportsExpansionTransitionProgress;
58 } 58 }
59 59
60 static bool supportsContentAreaScrolledInDirection() 60 static bool supportsContentAreaScrolledInDirection()
61 { 61 {
62 static bool globalSupportsContentAreaScrolledInDirection = [NSClassFromStrin g(@"NSScrollerImpPair") instancesRespondToSelector:@selector(contentAreaScrolled InDirection:)]; 62 static bool globalSupportsContentAreaScrolledInDirection = [NSClassFromStrin g(@"NSScrollerImpPair") instancesRespondToSelector:@selector(contentAreaScrolled InDirection:)];
63 return globalSupportsContentAreaScrolledInDirection; 63 return globalSupportsContentAreaScrolledInDirection;
64 } 64 }
65 65
66 static ScrollbarThemeMac* macScrollbarTheme() 66 static ScrollbarThemeMacOverlay* macOverlayScrollbarTheme()
67 { 67 {
68 ScrollbarTheme* scrollbarTheme = ScrollbarTheme::theme(); 68 ScrollbarTheme* scrollbarTheme = ScrollbarTheme::theme();
69 return !scrollbarTheme->isMockTheme() ? static_cast<ScrollbarThemeMac*>(scro llbarTheme) : 0; 69 return !scrollbarTheme->isMockTheme() ? static_cast<ScrollbarThemeMacOverlay *>(scrollbarTheme) : 0;
enne (OOO) 2013/07/31 18:23:59 So, I *think* this is only for overlay scrollbars,
ccameron 2013/07/31 20:26:57 Yes, there should be an ASSERT added. Done.
70 } 70 }
71 71
72 static ScrollbarPainter scrollbarPainterForScrollbar(Scrollbar* scrollbar) 72 static ScrollbarPainter scrollbarPainterForScrollbar(Scrollbar* scrollbar)
73 { 73 {
74 if (ScrollbarThemeMac* scrollbarTheme = macScrollbarTheme()) 74 if (ScrollbarThemeMacOverlay* scrollbarTheme = macOverlayScrollbarTheme())
75 return scrollbarTheme->painterForScrollbar(scrollbar); 75 return scrollbarTheme->painterForScrollbar(scrollbar);
76 76
77 return nil; 77 return nil;
78 } 78 }
79 79
80 @interface NSObject (ScrollAnimationHelperDetails) 80 @interface NSObject (ScrollAnimationHelperDetails)
81 - (id)initWithDelegate:(id)delegate; 81 - (id)initWithDelegate:(id)delegate;
82 - (void)_stopRun; 82 - (void)_stopRun;
83 - (BOOL)_isAnimating; 83 - (BOOL)_isAnimating;
84 - (NSPoint)targetOrigin; 84 - (NSPoint)targetOrigin;
(...skipping 1097 matching lines...) Expand 10 before | Expand all | Expand 10 after
1182 void ScrollAnimatorMac::updateScrollerStyle() 1182 void ScrollAnimatorMac::updateScrollerStyle()
1183 { 1183 {
1184 if (!isScrollbarOverlayAPIAvailable()) 1184 if (!isScrollbarOverlayAPIAvailable())
1185 return; 1185 return;
1186 1186
1187 if (!scrollableArea()->scrollbarsCanBeActive()) { 1187 if (!scrollableArea()->scrollbarsCanBeActive()) {
1188 m_needsScrollerStyleUpdate = true; 1188 m_needsScrollerStyleUpdate = true;
1189 return; 1189 return;
1190 } 1190 }
1191 1191
1192 ScrollbarThemeMac* macTheme = macScrollbarTheme(); 1192 ScrollbarThemeMacOverlay* macTheme = macOverlayScrollbarTheme();
1193 if (!macTheme) { 1193 if (!macTheme) {
1194 m_needsScrollerStyleUpdate = false; 1194 m_needsScrollerStyleUpdate = false;
1195 return; 1195 return;
1196 } 1196 }
1197 1197
1198 NSScrollerStyle newStyle = [m_scrollbarPainterController.get() scrollerStyle ]; 1198 NSScrollerStyle newStyle = [m_scrollbarPainterController.get() scrollerStyle ];
1199 1199
1200 if (Scrollbar* verticalScrollbar = scrollableArea()->verticalScrollbar()) { 1200 if (Scrollbar* verticalScrollbar = scrollableArea()->verticalScrollbar()) {
1201 verticalScrollbar->invalidate(); 1201 verticalScrollbar->invalidate();
1202 1202
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
1292 return; 1292 return;
1293 1293
1294 m_visibleScrollerThumbRect = rectInViewCoordinates; 1294 m_visibleScrollerThumbRect = rectInViewCoordinates;
1295 } 1295 }
1296 1296
1297 bool ScrollAnimatorMac::canUseCoordinatedScrollbar() { 1297 bool ScrollAnimatorMac::canUseCoordinatedScrollbar() {
1298 return isScrollbarOverlayAPIAvailable(); 1298 return isScrollbarOverlayAPIAvailable();
1299 } 1299 }
1300 1300
1301 } // namespace WebCore 1301 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | Source/core/platform/mac/ScrollbarThemeMac.h » ('j') | Source/core/platform/mac/ScrollbarThemeMac.mm » ('J')

Powered by Google App Engine
This is Rietveld 408576698