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

Unified Diff: third_party/WebKit/Source/core/paint/PaintInvalidationCapableScrollableArea.cpp

Issue 2631113003: Add metric to know how user use scrollbar (Closed)
Patch Set: rebase Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/paint/PaintInvalidationCapableScrollableArea.cpp
diff --git a/third_party/WebKit/Source/core/paint/PaintInvalidationCapableScrollableArea.cpp b/third_party/WebKit/Source/core/paint/PaintInvalidationCapableScrollableArea.cpp
index 36899a94016fae97c00e6de3150deec10e136cdd..0fdbed2aaae7b32e9b01dd77ffe4bdaedc10b9eb 100644
--- a/third_party/WebKit/Source/core/paint/PaintInvalidationCapableScrollableArea.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintInvalidationCapableScrollableArea.cpp
@@ -5,6 +5,7 @@
#include "core/paint/PaintInvalidationCapableScrollableArea.h"
#include "core/frame/Settings.h"
+#include "core/frame/UseCounter.h"
#include "core/html/HTMLFrameOwnerElement.h"
#include "core/layout/LayoutBox.h"
#include "core/layout/LayoutScrollbar.h"
@@ -204,4 +205,38 @@ void PaintInvalidationCapableScrollableArea::
layoutBox()->setMayNeedPaintInvalidation();
}
+void PaintInvalidationCapableScrollableArea::didScrollWithScrollbar(
+ ScrollbarPart part,
+ ScrollbarOrientation orientation) {
+ UseCounter::Feature scrollbarUseUMA;
+ switch (part) {
+ case BackButtonStartPart:
+ case ForwardButtonStartPart:
+ case BackButtonEndPart:
+ case ForwardButtonEndPart:
+ scrollbarUseUMA =
+ (orientation == VerticalScrollbar
+ ? UseCounter::ScrollbarUseVerticalScrollbarButton
+ : UseCounter::ScrollbarUseHorizontalScrollbarButton);
+ break;
+ case ThumbPart:
+ scrollbarUseUMA =
+ (orientation == VerticalScrollbar
+ ? UseCounter::ScrollbarUseVerticalScrollbarThumb
+ : UseCounter::ScrollbarUseHorizontalScrollbarThumb);
+ break;
+ case BackTrackPart:
+ case ForwardTrackPart:
+ scrollbarUseUMA =
+ (orientation == VerticalScrollbar
+ ? UseCounter::ScrollbarUseVerticalScrollbarTrack
+ : UseCounter::ScrollbarUseHorizontalScrollbarTrack);
+ break;
+ default:
+ return;
+ }
+
+ UseCounter::count(layoutBox()->document(), scrollbarUseUMA);
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698