| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "core/paint/PaintInvalidationCapableScrollableArea.h" | 5 #include "core/paint/PaintInvalidationCapableScrollableArea.h" |
| 6 | 6 |
| 7 #include "core/frame/Settings.h" | 7 #include "core/frame/Settings.h" |
| 8 #include "core/frame/UseCounter.h" |
| 8 #include "core/html/HTMLFrameOwnerElement.h" | 9 #include "core/html/HTMLFrameOwnerElement.h" |
| 9 #include "core/layout/LayoutBox.h" | 10 #include "core/layout/LayoutBox.h" |
| 10 #include "core/layout/LayoutScrollbar.h" | 11 #include "core/layout/LayoutScrollbar.h" |
| 11 #include "core/layout/LayoutScrollbarPart.h" | 12 #include "core/layout/LayoutScrollbarPart.h" |
| 12 #include "core/paint/ObjectPaintInvalidator.h" | 13 #include "core/paint/ObjectPaintInvalidator.h" |
| 13 #include "core/paint/PaintInvalidator.h" | 14 #include "core/paint/PaintInvalidator.h" |
| 14 #include "core/paint/PaintLayer.h" | 15 #include "core/paint/PaintLayer.h" |
| 15 #include "platform/graphics/GraphicsLayer.h" | 16 #include "platform/graphics/GraphicsLayer.h" |
| 16 | 17 |
| 17 namespace blink { | 18 namespace blink { |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 fullBounds.unite(m_verticalScrollbarPreviousVisualRect); | 198 fullBounds.unite(m_verticalScrollbarPreviousVisualRect); |
| 198 fullBounds.unite(m_scrollCornerAndResizerPreviousVisualRect); | 199 fullBounds.unite(m_scrollCornerAndResizerPreviousVisualRect); |
| 199 return fullBounds; | 200 return fullBounds; |
| 200 } | 201 } |
| 201 | 202 |
| 202 void PaintInvalidationCapableScrollableArea:: | 203 void PaintInvalidationCapableScrollableArea:: |
| 203 scrollControlWasSetNeedsPaintInvalidation() { | 204 scrollControlWasSetNeedsPaintInvalidation() { |
| 204 layoutBox()->setMayNeedPaintInvalidation(); | 205 layoutBox()->setMayNeedPaintInvalidation(); |
| 205 } | 206 } |
| 206 | 207 |
| 208 void PaintInvalidationCapableScrollableArea::didScrollWithScrollbar( |
| 209 ScrollbarPart part, |
| 210 ScrollbarOrientation orientation) { |
| 211 UseCounter::Feature scrollbarUseUMA; |
| 212 switch (part) { |
| 213 case BackButtonStartPart: |
| 214 case ForwardButtonStartPart: |
| 215 case BackButtonEndPart: |
| 216 case ForwardButtonEndPart: |
| 217 scrollbarUseUMA = |
| 218 (orientation == VerticalScrollbar |
| 219 ? UseCounter::ScrollbarUseVerticalScrollbarButton |
| 220 : UseCounter::ScrollbarUseHorizontalScrollbarButton); |
| 221 break; |
| 222 case ThumbPart: |
| 223 scrollbarUseUMA = |
| 224 (orientation == VerticalScrollbar |
| 225 ? UseCounter::ScrollbarUseVerticalScrollbarThumb |
| 226 : UseCounter::ScrollbarUseHorizontalScrollbarThumb); |
| 227 break; |
| 228 case BackTrackPart: |
| 229 case ForwardTrackPart: |
| 230 scrollbarUseUMA = |
| 231 (orientation == VerticalScrollbar |
| 232 ? UseCounter::ScrollbarUseVerticalScrollbarTrack |
| 233 : UseCounter::ScrollbarUseHorizontalScrollbarTrack); |
| 234 break; |
| 235 default: |
| 236 return; |
| 237 } |
| 238 |
| 239 UseCounter::count(layoutBox()->document(), scrollbarUseUMA); |
| 240 } |
| 241 |
| 207 } // namespace blink | 242 } // namespace blink |
| OLD | NEW |