| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2010, Google Inc. All rights reserved. | 2 * Copyright (c) 2010, Google Inc. All rights reserved. |
| 3 * Copyright (C) 2008, 2011 Apple Inc. All Rights Reserved. | 3 * Copyright (C) 2008, 2011 Apple Inc. All Rights Reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
| 7 * met: | 7 * met: |
| 8 * | 8 * |
| 9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 389 scroll_animator->ContentAreaDidHide(); | 389 scroll_animator->ContentAreaDidHide(); |
| 390 } | 390 } |
| 391 | 391 |
| 392 void ScrollableArea::FinishCurrentScrollAnimations() const { | 392 void ScrollableArea::FinishCurrentScrollAnimations() const { |
| 393 if (ScrollAnimatorBase* scroll_animator = ExistingScrollAnimator()) | 393 if (ScrollAnimatorBase* scroll_animator = ExistingScrollAnimator()) |
| 394 scroll_animator->FinishCurrentScrollAnimations(); | 394 scroll_animator->FinishCurrentScrollAnimations(); |
| 395 } | 395 } |
| 396 | 396 |
| 397 void ScrollableArea::DidAddScrollbar(Scrollbar& scrollbar, | 397 void ScrollableArea::DidAddScrollbar(Scrollbar& scrollbar, |
| 398 ScrollbarOrientation orientation) { | 398 ScrollbarOrientation orientation) { |
| 399 if (scrollbar.IsCustomScrollbar()) |
| 400 return; |
| 399 if (orientation == kVerticalScrollbar) | 401 if (orientation == kVerticalScrollbar) |
| 400 GetScrollAnimator().DidAddVerticalScrollbar(scrollbar); | 402 GetScrollAnimator().DidAddVerticalScrollbar(scrollbar); |
| 401 else | 403 else |
| 402 GetScrollAnimator().DidAddHorizontalScrollbar(scrollbar); | 404 GetScrollAnimator().DidAddHorizontalScrollbar(scrollbar); |
| 403 | 405 |
| 404 // <rdar://problem/9797253> AppKit resets the scrollbar's style when you | 406 // <rdar://problem/9797253> AppKit resets the scrollbar's style when you |
| 405 // attach a scrollbar | 407 // attach a scrollbar |
| 406 SetScrollbarOverlayColorTheme(GetScrollbarOverlayColorTheme()); | 408 SetScrollbarOverlayColorTheme(GetScrollbarOverlayColorTheme()); |
| 407 } | 409 } |
| 408 | 410 |
| 409 void ScrollableArea::WillRemoveScrollbar(Scrollbar& scrollbar, | 411 void ScrollableArea::WillRemoveScrollbar(Scrollbar& scrollbar, |
| 410 ScrollbarOrientation orientation) { | 412 ScrollbarOrientation orientation) { |
| 413 if (scrollbar.IsCustomScrollbar()) |
| 414 return; |
| 411 if (ScrollAnimatorBase* scroll_animator = ExistingScrollAnimator()) { | 415 if (ScrollAnimatorBase* scroll_animator = ExistingScrollAnimator()) { |
| 412 if (orientation == kVerticalScrollbar) | 416 if (orientation == kVerticalScrollbar) |
| 413 scroll_animator->WillRemoveVerticalScrollbar(scrollbar); | 417 scroll_animator->WillRemoveVerticalScrollbar(scrollbar); |
| 414 else | 418 else |
| 415 scroll_animator->WillRemoveHorizontalScrollbar(scrollbar); | 419 scroll_animator->WillRemoveHorizontalScrollbar(scrollbar); |
| 416 } | 420 } |
| 417 } | 421 } |
| 418 | 422 |
| 419 void ScrollableArea::ContentsResized() { | 423 void ScrollableArea::ContentsResized() { |
| 420 if (ScrollAnimatorBase* scroll_animator = ExistingScrollAnimator()) | 424 if (ScrollAnimatorBase* scroll_animator = ExistingScrollAnimator()) |
| (...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 690 offset.y() - ScrollOrigin().Y()); | 694 offset.y() - ScrollOrigin().Y()); |
| 691 SetScrollOffset(new_offset, kCompositorScroll); | 695 SetScrollOffset(new_offset, kCompositorScroll); |
| 692 } | 696 } |
| 693 | 697 |
| 694 DEFINE_TRACE(ScrollableArea) { | 698 DEFINE_TRACE(ScrollableArea) { |
| 695 visitor->Trace(scroll_animator_); | 699 visitor->Trace(scroll_animator_); |
| 696 visitor->Trace(programmatic_scroll_animator_); | 700 visitor->Trace(programmatic_scroll_animator_); |
| 697 } | 701 } |
| 698 | 702 |
| 699 } // namespace blink | 703 } // namespace blink |
| OLD | NEW |