OLD | NEW |
---|---|
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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
85 [_scrollbarPainter.get() removeObserver:self forKeyPath:@"knobAlpha"]; | 85 [_scrollbarPainter.get() removeObserver:self forKeyPath:@"knobAlpha"]; |
86 [super dealloc]; | 86 [super dealloc]; |
87 } | 87 } |
88 | 88 |
89 - (void)observeValueForKeyPath:(NSString*)keyPath | 89 - (void)observeValueForKeyPath:(NSString*)keyPath |
90 ofObject:(id)object | 90 ofObject:(id)object |
91 change:(NSDictionary*)change | 91 change:(NSDictionary*)change |
92 context:(void*)context { | 92 context:(void*)context { |
93 if ([keyPath isEqualToString:@"knobAlpha"]) { | 93 if ([keyPath isEqualToString:@"knobAlpha"]) { |
94 BOOL visible = [_scrollbarPainter.get() knobAlpha] > 0; | 94 BOOL visible = [_scrollbarPainter.get() knobAlpha] > 0; |
95 if (_visible != visible) { | 95 _scrollbar->setScrollbarsHidden(!visible); |
dtapuska
2016/11/02 16:53:21
Can we remove the _visible member now?
bokan
2016/11/02 22:41:57
Done.
| |
96 _visible = visible; | |
97 _scrollbar->visibilityChanged(); | |
98 } | |
99 } | 96 } |
100 } | 97 } |
101 | 98 |
102 @end | 99 @end |
103 | 100 |
104 namespace blink { | 101 namespace blink { |
105 | 102 |
106 typedef HashSet<ScrollbarThemeClient*> ScrollbarSet; | 103 typedef HashSet<ScrollbarThemeClient*> ScrollbarSet; |
107 | 104 |
108 static ScrollbarSet& scrollbarSet() { | 105 static ScrollbarSet& scrollbarSet() { |
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
467 } | 464 } |
468 | 465 |
469 // static | 466 // static |
470 NSScrollerStyle ScrollbarThemeMac::recommendedScrollerStyle() { | 467 NSScrollerStyle ScrollbarThemeMac::recommendedScrollerStyle() { |
471 if (RuntimeEnabledFeatures::overlayScrollbarsEnabled()) | 468 if (RuntimeEnabledFeatures::overlayScrollbarsEnabled()) |
472 return NSScrollerStyleOverlay; | 469 return NSScrollerStyleOverlay; |
473 return gPreferredScrollerStyle; | 470 return gPreferredScrollerStyle; |
474 } | 471 } |
475 | 472 |
476 } // namespace blink | 473 } // namespace blink |
OLD | NEW |