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

Side by Side Diff: third_party/WebKit/Source/platform/scroll/ScrollableArea.cpp

Issue 2942163002: [Refactor] Moved scrollbar creation and deletion to ScrollbarManager (Closed)
Patch Set: bokan and skobes comments addressed Created 3 years, 5 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
« no previous file with comments | « third_party/WebKit/Source/platform/scroll/ScrollableArea.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/scroll/ScrollableArea.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698