OLD | NEW |
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 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 // moment when its destructor has been called. We should probably de-couple | 230 // moment when its destructor has been called. We should probably de-couple |
231 // some | 231 // some |
232 // of the clean-up work in ScrollbarThemeMac::unregisterScrollbar() to avoid | 232 // of the clean-up work in ScrollbarThemeMac::unregisterScrollbar() to avoid |
233 // this | 233 // this |
234 // issue. | 234 // issue. |
235 if (!scrollbar) | 235 if (!scrollbar) |
236 return NSZeroPoint; | 236 return NSZeroPoint; |
237 | 237 |
238 ASSERT(scrollerImp == scrollbarPainterForScrollbar(*scrollbar)); | 238 ASSERT(scrollerImp == scrollbarPainterForScrollbar(*scrollbar)); |
239 | 239 |
240 return scrollbar->ConvertFromContainingFrameViewBase( | 240 return scrollbar->ConvertFromContainingFrameView( |
241 blink::IntPoint(pointInContentArea)); | 241 blink::IntPoint(pointInContentArea)); |
242 } | 242 } |
243 | 243 |
244 - (void)scrollerImpPair:(id)scrollerImpPair | 244 - (void)scrollerImpPair:(id)scrollerImpPair |
245 setContentAreaNeedsDisplayInRect:(NSRect)rect { | 245 setContentAreaNeedsDisplayInRect:(NSRect)rect { |
246 if (!_scrollableArea) | 246 if (!_scrollableArea) |
247 return; | 247 return; |
248 | 248 |
249 if (!_scrollableArea->ScrollbarsCanBeActive()) | 249 if (!_scrollableArea->ScrollbarsCanBeActive()) |
250 return; | 250 return; |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
488 - (NSRect)convertRectFromBacking:(NSRect)aRect { | 488 - (NSRect)convertRectFromBacking:(NSRect)aRect { |
489 return aRect; | 489 return aRect; |
490 } | 490 } |
491 | 491 |
492 - (NSPoint)mouseLocationInScrollerForScrollerImp:(id)scrollerImp { | 492 - (NSPoint)mouseLocationInScrollerForScrollerImp:(id)scrollerImp { |
493 if (!_scrollbar) | 493 if (!_scrollbar) |
494 return NSZeroPoint; | 494 return NSZeroPoint; |
495 | 495 |
496 DCHECK_EQ(scrollerImp, scrollbarPainterForScrollbar(*_scrollbar)); | 496 DCHECK_EQ(scrollerImp, scrollbarPainterForScrollbar(*_scrollbar)); |
497 | 497 |
498 return _scrollbar->ConvertFromContainingFrameViewBase( | 498 return _scrollbar->ConvertFromContainingFrameView( |
499 _scrollbar->GetScrollableArea()->LastKnownMousePosition()); | 499 _scrollbar->GetScrollableArea()->LastKnownMousePosition()); |
500 } | 500 } |
501 | 501 |
502 - (void)setUpAlphaAnimation: | 502 - (void)setUpAlphaAnimation: |
503 (RetainPtr<BlinkScrollbarPartAnimation>&)scrollbarPartAnimation | 503 (RetainPtr<BlinkScrollbarPartAnimation>&)scrollbarPartAnimation |
504 scrollerPainter:(ScrollbarPainter)scrollerPainter | 504 scrollerPainter:(ScrollbarPainter)scrollerPainter |
505 part:(blink::ScrollbarPart)part | 505 part:(blink::ScrollbarPart)part |
506 animateAlphaTo:(CGFloat)newAlpha | 506 animateAlphaTo:(CGFloat)newAlpha |
507 duration:(NSTimeInterval)duration { | 507 duration:(NSTimeInterval)duration { |
508 // If the user has scrolled the page, then the scrollbars must be animated | 508 // If the user has scrolled the page, then the scrollbars must be animated |
(...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1074 content_area_scrolled_timer_scroll_delta_ = ScrollOffset(); | 1074 content_area_scrolled_timer_scroll_delta_ = ScrollOffset(); |
1075 } else | 1075 } else |
1076 [scrollbar_painter_controller_.Get() contentAreaScrolled]; | 1076 [scrollbar_painter_controller_.Get() contentAreaScrolled]; |
1077 } | 1077 } |
1078 | 1078 |
1079 void ScrollAnimatorMac::SetVisibleScrollerThumbRect( | 1079 void ScrollAnimatorMac::SetVisibleScrollerThumbRect( |
1080 const IntRect& scroller_thumb) { | 1080 const IntRect& scroller_thumb) { |
1081 IntRect rect_in_view_coordinates = scroller_thumb; | 1081 IntRect rect_in_view_coordinates = scroller_thumb; |
1082 if (Scrollbar* vertical_scrollbar = scrollable_area_->VerticalScrollbar()) | 1082 if (Scrollbar* vertical_scrollbar = scrollable_area_->VerticalScrollbar()) |
1083 rect_in_view_coordinates = | 1083 rect_in_view_coordinates = |
1084 vertical_scrollbar->ConvertToContainingFrameViewBase(scroller_thumb); | 1084 vertical_scrollbar->ConvertToContainingFrameView(scroller_thumb); |
1085 | 1085 |
1086 if (rect_in_view_coordinates == visible_scroller_thumb_rect_) | 1086 if (rect_in_view_coordinates == visible_scroller_thumb_rect_) |
1087 return; | 1087 return; |
1088 | 1088 |
1089 visible_scroller_thumb_rect_ = rect_in_view_coordinates; | 1089 visible_scroller_thumb_rect_ = rect_in_view_coordinates; |
1090 } | 1090 } |
1091 | 1091 |
1092 } // namespace blink | 1092 } // namespace blink |
OLD | NEW |