| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 return *map; | 97 return *map; |
| 98 } | 98 } |
| 99 | 99 |
| 100 static bool supportsExpandedScrollbars() | 100 static bool supportsExpandedScrollbars() |
| 101 { | 101 { |
| 102 // FIXME: This is temporary until all platforms that support ScrollbarPainte
r support this part of the API. | 102 // FIXME: This is temporary until all platforms that support ScrollbarPainte
r support this part of the API. |
| 103 static bool globalSupportsExpandedScrollbars = [NSClassFromString(@"NSScroll
erImp") instancesRespondToSelector:@selector(setExpanded:)]; | 103 static bool globalSupportsExpandedScrollbars = [NSClassFromString(@"NSScroll
erImp") instancesRespondToSelector:@selector(setExpanded:)]; |
| 104 return globalSupportsExpandedScrollbars; | 104 return globalSupportsExpandedScrollbars; |
| 105 } | 105 } |
| 106 | 106 |
| 107 ScrollbarPart ScrollbarThemeMacOverlayAPI::invalidateOnThumbPositionChange( |
| 108 const ScrollbarThemeClient& scrollbar, float oldPosition, float newPosition)
const |
| 109 { |
| 110 // ScrollAnimatorMac will invalidate scrollbar parts if necessary. |
| 111 return NoPart; |
| 112 } |
| 113 |
| 107 void ScrollbarThemeMacOverlayAPI::registerScrollbar(ScrollbarThemeClient& scroll
bar) | 114 void ScrollbarThemeMacOverlayAPI::registerScrollbar(ScrollbarThemeClient& scroll
bar) |
| 108 { | 115 { |
| 109 ScrollbarThemeMacCommon::registerScrollbar(scrollbar); | 116 ScrollbarThemeMacCommon::registerScrollbar(scrollbar); |
| 110 | 117 |
| 111 bool isHorizontal = scrollbar.orientation() == HorizontalScrollbar; | 118 bool isHorizontal = scrollbar.orientation() == HorizontalScrollbar; |
| 112 ScrollbarPainter scrollbarPainter = [NSClassFromString(@"NSScrollerImp") scr
ollerImpWithStyle:recommendedScrollerStyle() controlSize:(NSControlSize)scrollba
r.controlSize() horizontal:isHorizontal replacingScrollerImp:nil]; | 119 ScrollbarPainter scrollbarPainter = [NSClassFromString(@"NSScrollerImp") scr
ollerImpWithStyle:recommendedScrollerStyle() controlSize:(NSControlSize)scrollba
r.controlSize() horizontal:isHorizontal replacingScrollerImp:nil]; |
| 113 RetainPtr<BlinkScrollbarObserver> observer = [[BlinkScrollbarObserver alloc]
initWithScrollbar:&scrollbar painter:scrollbarPainter]; | 120 RetainPtr<BlinkScrollbarObserver> observer = [[BlinkScrollbarObserver alloc]
initWithScrollbar:&scrollbar painter:scrollbarPainter]; |
| 114 | 121 |
| 115 scrollbarPainterMap().add(&scrollbar, observer); | 122 scrollbarPainterMap().add(&scrollbar, observer); |
| 116 updateEnabledState(scrollbar); | 123 updateEnabledState(scrollbar); |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 [painterForScrollbar(scrollbar) setEnabled:scrollbar.enabled()]; | 276 [painterForScrollbar(scrollbar) setEnabled:scrollbar.enabled()]; |
| 270 } | 277 } |
| 271 | 278 |
| 272 float ScrollbarThemeMacOverlayAPI::thumbOpacity(const ScrollbarThemeClient& scro
llbar) const { | 279 float ScrollbarThemeMacOverlayAPI::thumbOpacity(const ScrollbarThemeClient& scro
llbar) const { |
| 273 ScrollbarPainter scrollbarPainter = painterForScrollbar(scrollbar); | 280 ScrollbarPainter scrollbarPainter = painterForScrollbar(scrollbar); |
| 274 return [scrollbarPainter knobAlpha]; | 281 return [scrollbarPainter knobAlpha]; |
| 275 } | 282 } |
| 276 | 283 |
| 277 } // namespace blink | 284 } // namespace blink |
| 278 | 285 |
| OLD | NEW |