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

Side by Side Diff: third_party/WebKit/Source/platform/scroll/ScrollbarThemeMac.mm

Issue 1863513002: Mac: Remove some remaining 10.6 logic for absent overlay scrollbar APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Zap notification, import appkit rather than forward decs 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008, 2011 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008, 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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 204
205 ScrollbarThemeMac::~ScrollbarThemeMac() 205 ScrollbarThemeMac::~ScrollbarThemeMac()
206 { 206 {
207 } 207 }
208 208
209 void ScrollbarThemeMac::preferencesChanged(float initialButtonDelay, float autos crollButtonDelay, NSScrollerStyle preferredScrollerStyle, bool redraw, WebScroll barButtonsPlacement buttonPlacement) 209 void ScrollbarThemeMac::preferencesChanged(float initialButtonDelay, float autos crollButtonDelay, NSScrollerStyle preferredScrollerStyle, bool redraw, WebScroll barButtonsPlacement buttonPlacement)
210 { 210 {
211 updateButtonPlacement(buttonPlacement); 211 updateButtonPlacement(buttonPlacement);
212 gInitialButtonDelay = initialButtonDelay; 212 gInitialButtonDelay = initialButtonDelay;
213 gAutoscrollButtonDelay = autoscrollButtonDelay; 213 gAutoscrollButtonDelay = autoscrollButtonDelay;
214 bool sendScrollerStyleNotification = gPreferredScrollerStyle != preferredScr ollerStyle;
215 gPreferredScrollerStyle = preferredScrollerStyle; 214 gPreferredScrollerStyle = preferredScrollerStyle;
216 if (redraw && !scrollbarSet().isEmpty()) { 215 if (redraw && !scrollbarSet().isEmpty()) {
217 ScrollbarSet::iterator end = scrollbarSet().end(); 216 ScrollbarSet::iterator end = scrollbarSet().end();
218 for (ScrollbarSet::iterator it = scrollbarSet().begin(); it != end; ++it ) { 217 for (ScrollbarSet::iterator it = scrollbarSet().begin(); it != end; ++it ) {
219 (*it)->styleChanged(); 218 (*it)->styleChanged();
220 (*it)->invalidate(); 219 (*it)->invalidate();
221 } 220 }
222 } 221 }
223 if (sendScrollerStyleNotification) {
224 [[NSNotificationCenter defaultCenter]
225 postNotificationName:@"NSPreferredScrollerStyleDidChangeNotification "
226 object:nil
227 userInfo:@{ @"NSScrollerStyle" : @(gPreferredScrollerSty le) }];
228 }
229 } 222 }
230 223
231 double ScrollbarThemeMac::initialAutoscrollTimerDelay() 224 double ScrollbarThemeMac::initialAutoscrollTimerDelay()
232 { 225 {
233 return gInitialButtonDelay; 226 return gInitialButtonDelay;
234 } 227 }
235 228
236 double ScrollbarThemeMac::autoscrollTimerDelay() 229 double ScrollbarThemeMac::autoscrollTimerDelay()
237 { 230 {
238 return gAutoscrollButtonDelay; 231 return gAutoscrollButtonDelay;
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 428
436 // static 429 // static
437 NSScrollerStyle ScrollbarThemeMac::recommendedScrollerStyle() 430 NSScrollerStyle ScrollbarThemeMac::recommendedScrollerStyle()
438 { 431 {
439 if (RuntimeEnabledFeatures::overlayScrollbarsEnabled()) 432 if (RuntimeEnabledFeatures::overlayScrollbarsEnabled())
440 return NSScrollerStyleOverlay; 433 return NSScrollerStyleOverlay;
441 return gPreferredScrollerStyle; 434 return gPreferredScrollerStyle;
442 } 435 }
443 436
444 } // namespace blink 437 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/mac/NSScrollerImpDetails.h ('k') | ui/base/test/scoped_preferred_scroller_style_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698