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

Unified Diff: third_party/WebKit/Source/core/frame/FrameView.cpp

Issue 2631113003: Add metric to know how user use scrollbar (Closed)
Patch Set: move to UseCounter 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/frame/FrameView.cpp
diff --git a/third_party/WebKit/Source/core/frame/FrameView.cpp b/third_party/WebKit/Source/core/frame/FrameView.cpp
index 8dca0e8f9700cd8ca2a3826cac3351acb2f3da67..7350756eb8c641e8859d2d9ac587878315e71ebd 100644
--- a/third_party/WebKit/Source/core/frame/FrameView.cpp
+++ b/third_party/WebKit/Source/core/frame/FrameView.cpp
@@ -55,6 +55,7 @@
#include "core/frame/RemoteFrame.h"
#include "core/frame/RemoteFrameView.h"
#include "core/frame/Settings.h"
+#include "core/frame/UseCounter.h"
#include "core/frame/VisualViewport.h"
#include "core/html/HTMLFrameElement.h"
#include "core/html/HTMLPlugInElement.h"
@@ -3756,6 +3757,39 @@ void FrameView::setScrollbarModes(ScrollbarMode horizontalMode,
userInputScrollable(VerticalScrollbar));
}
+void FrameView::sendScrollbarUseUMA(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(&frame(), scrollbarUseUMA);
+}
+
IntSize FrameView::visibleContentSize(
IncludeScrollbarsInRect scrollbarInclusion) const {
return scrollbarInclusion == ExcludeScrollbars

Powered by Google App Engine
This is Rietveld 408576698