Chromium Code Reviews| 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 45 #include "platform/TraceEvent.h" | 45 #include "platform/TraceEvent.h" |
| 46 | 46 |
| 47 static const int kPixelsPerLineStep = 40; | 47 static const int kPixelsPerLineStep = 40; |
| 48 static const float kMinFractionToStepWhenPaging = 0.875f; | 48 static const float kMinFractionToStepWhenPaging = 0.875f; |
| 49 | 49 |
| 50 namespace blink { | 50 namespace blink { |
| 51 | 51 |
| 52 struct SameSizeAsScrollableArea { | 52 struct SameSizeAsScrollableArea { |
| 53 virtual ~SameSizeAsScrollableArea(); | 53 virtual ~SameSizeAsScrollableArea(); |
| 54 IntRect scrollbarDamage[2]; | 54 IntRect scrollbarDamage[2]; |
| 55 #if ENABLE(ASSERT) && ENABLE(OILPAN) | |
| 56 VerifyEagerFinalization verifyEager; | |
|
haraken
2015/06/30 10:30:36
Nit: This could be removed if we use a pre-finaliz
| |
| 57 #endif | |
| 55 void* pointer; | 58 void* pointer; |
| 56 unsigned bitfields : 16; | 59 unsigned bitfields : 16; |
| 57 IntPoint origin; | 60 IntPoint origin; |
| 58 }; | 61 }; |
| 59 | 62 |
| 60 static_assert(sizeof(ScrollableArea) == sizeof(SameSizeAsScrollableArea), "Scrol lableArea should stay small"); | 63 static_assert(sizeof(ScrollableArea) == sizeof(SameSizeAsScrollableArea), "Scrol lableArea should stay small"); |
| 61 | 64 |
| 62 int ScrollableArea::pixelsPerLineStep() | 65 int ScrollableArea::pixelsPerLineStep() |
| 63 { | 66 { |
| 64 return kPixelsPerLineStep; | 67 return kPixelsPerLineStep; |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 79 : m_inLiveResize(false) | 82 : m_inLiveResize(false) |
| 80 , m_scrollbarOverlayStyle(ScrollbarOverlayStyleDefault) | 83 , m_scrollbarOverlayStyle(ScrollbarOverlayStyleDefault) |
| 81 , m_scrollOriginChanged(false) | 84 , m_scrollOriginChanged(false) |
| 82 { | 85 { |
| 83 } | 86 } |
| 84 | 87 |
| 85 ScrollableArea::~ScrollableArea() | 88 ScrollableArea::~ScrollableArea() |
| 86 { | 89 { |
| 87 } | 90 } |
| 88 | 91 |
| 92 void ScrollableArea::clearScrollAnimators() | |
| 93 { | |
| 94 m_animators.clear(); | |
| 95 } | |
| 96 | |
| 89 ScrollAnimator* ScrollableArea::scrollAnimator() const | 97 ScrollAnimator* ScrollableArea::scrollAnimator() const |
| 90 { | 98 { |
| 91 if (!m_animators) | 99 if (!m_animators) |
| 92 m_animators = adoptPtr(new ScrollableAreaAnimators); | 100 m_animators = adoptPtr(new ScrollableAreaAnimators); |
| 93 | 101 |
| 94 if (!m_animators->scrollAnimator) | 102 if (!m_animators->scrollAnimator) |
| 95 m_animators->scrollAnimator = ScrollAnimator::create(const_cast<Scrollab leArea*>(this)); | 103 m_animators->scrollAnimator = ScrollAnimator::create(const_cast<Scrollab leArea*>(this)); |
| 96 | 104 |
| 97 return m_animators->scrollAnimator.get(); | 105 return m_animators->scrollAnimator.get(); |
| 98 } | 106 } |
| (...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 602 verticalScrollbarWidth = !verticalBar->isOverlayScrollbar() ? verticalBa r->width() : 0; | 610 verticalScrollbarWidth = !verticalBar->isOverlayScrollbar() ? verticalBa r->width() : 0; |
| 603 if (Scrollbar* horizontalBar = horizontalScrollbar()) | 611 if (Scrollbar* horizontalBar = horizontalScrollbar()) |
| 604 horizontalScrollbarHeight = !horizontalBar->isOverlayScrollbar() ? horiz ontalBar->height() : 0; | 612 horizontalScrollbarHeight = !horizontalBar->isOverlayScrollbar() ? horiz ontalBar->height() : 0; |
| 605 | 613 |
| 606 return IntSize(std::max(0, size.width() - verticalScrollbarWidth), | 614 return IntSize(std::max(0, size.width() - verticalScrollbarWidth), |
| 607 std::max(0, size.height() - horizontalScrollbarHeight)); | 615 std::max(0, size.height() - horizontalScrollbarHeight)); |
| 608 | 616 |
| 609 } | 617 } |
| 610 | 618 |
| 611 } // namespace blink | 619 } // namespace blink |
| OLD | NEW |