Commit 8aaf4ec7 authored by mlamouri's avatar mlamouri Committed by Commit bot

Record clicks on download and overflow buttons in media controls.

BUG=650592

Review-Url: https://codereview.chromium.org/2370233002
Cr-Commit-Position: refs/heads/master@{#421329}
parent 0f3842e8
......@@ -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, "");
......
......@@ -8661,6 +8661,11 @@ should be able to be added at any place in this file.
</description>
</action>
<action name="Media.Controls.Download">
<owner>mlamouri@chromium.org</owner>
<description>The user clicked on the controls' download button.</description>
</action>
<action name="Media.Controls.EnterFullscreen">
<owner>mlamouri@chromium.org</owner>
<description>The user entered fullscreen mode from the controls.</description>
......@@ -8676,6 +8681,16 @@ should be able to be added at any place in this file.
<description>The user muted a media element from the controls.</description>
</action>
<action name="Media.Controls.OverflowClose">
<owner>mlamouri@chromium.org</owner>
<description>The user closed the overflow menu via the controls.</description>
</action>
<action name="Media.Controls.OverflowOpen">
<owner>mlamouri@chromium.org</owner>
<description>The user opened the overflow menu via the controls.</description>
</action>
<action name="Media.Controls.Pause">
<owner>mlamouri@chromium.org</owner>
<description>The user paused a media element from the controls.</description>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment