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

Unified Diff: third_party/WebKit/Source/core/html/shadow/MediaControlElements.cpp

Issue 2370233002: Record clicks on download and overflow buttons in media controls. (Closed)
Patch Set: Created 4 years, 3 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
« no previous file with comments | « no previous file | tools/metrics/actions/actions.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/html/shadow/MediaControlElements.cpp
diff --git a/third_party/WebKit/Source/core/html/shadow/MediaControlElements.cpp b/third_party/WebKit/Source/core/html/shadow/MediaControlElements.cpp
index ca8daee9c220ed634c0e474bcee53b193fa6f119..0acc5c4474a096d5b569cde752b3b36b838245b3 100644
--- a/third_party/WebKit/Source/core/html/shadow/MediaControlElements.cpp
+++ b/third_party/WebKit/Source/core/html/shadow/MediaControlElements.cpp
@@ -598,6 +598,11 @@ MediaControlOverflowMenuButtonElement* MediaControlOverflowMenuButtonElement::cr
void MediaControlOverflowMenuButtonElement::defaultEventHandler(Event* event)
{
if (event->type() == EventTypeNames::click) {
+ if (mediaControls().overflowMenuVisible())
+ Platform::current()->recordAction(UserMetricsAction("Media.Controls.OverflowClose"));
+ else
+ Platform::current()->recordAction(UserMetricsAction("Media.Controls.OverflowOpen"));
+
mediaControls().toggleOverflowMenu();
event->setDefaultHandled();
}
@@ -662,6 +667,7 @@ void MediaControlDownloadButtonElement::defaultEventHandler(Event* event)
{
const KURL& url = mediaElement().currentSrc();
if (event->type() == EventTypeNames::click && !(url.isNull() || url.isEmpty())) {
+ Platform::current()->recordAction(UserMetricsAction("Media.Controls.Download"));
if (!m_anchor) {
HTMLAnchorElement* anchor = HTMLAnchorElement::create(document());
anchor->setAttribute(HTMLNames::downloadAttr, "");
« no previous file with comments | « no previous file | tools/metrics/actions/actions.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698