| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 "modules/media_controls/elements/MediaControlDownloadButtonElement.h" | 5 #include "modules/media_controls/elements/MediaControlDownloadButtonElement.h" |
| 6 | 6 |
| 7 #include "core/InputTypeNames.h" | 7 #include "core/InputTypeNames.h" |
| 8 #include "core/events/Event.h" | 8 #include "core/events/Event.h" |
| 9 #include "core/frame/Settings.h" | 9 #include "core/frame/Settings.h" |
| 10 #include "core/html/HTMLAnchorElement.h" | 10 #include "core/html/HTMLAnchorElement.h" |
| 11 #include "core/html/HTMLMediaElement.h" | 11 #include "core/html/HTMLMediaElement.h" |
| 12 #include "core/html/media/HTMLMediaElementControlsList.h" | 12 #include "core/html/media/HTMLMediaElementControlsList.h" |
| 13 #include "core/html/media/HTMLMediaSource.h" | 13 #include "core/html/media/HTMLMediaSource.h" |
| 14 #include "core/page/Page.h" | 14 #include "core/page/Page.h" |
| 15 #include "modules/media_controls/MediaControlsImpl.h" | 15 #include "modules/media_controls/MediaControlsImpl.h" |
| 16 #include "platform/Histogram.h" |
| 16 #include "public/platform/Platform.h" | 17 #include "public/platform/Platform.h" |
| 17 | 18 |
| 18 namespace blink { | 19 namespace blink { |
| 19 | 20 |
| 20 MediaControlDownloadButtonElement::MediaControlDownloadButtonElement( | 21 MediaControlDownloadButtonElement::MediaControlDownloadButtonElement( |
| 21 MediaControlsImpl& media_controls) | 22 MediaControlsImpl& media_controls) |
| 22 : MediaControlInputElement(media_controls, kMediaDownloadButton) { | 23 : MediaControlInputElement(media_controls, kMediaDownloadButton) { |
| 23 EnsureUserAgentShadowRoot(); | 24 EnsureUserAgentShadowRoot(); |
| 24 setType(InputTypeNames::button); | 25 setType(InputTypeNames::button); |
| 25 SetShadowPseudoId(AtomicString("-internal-media-controls-download-button")); | 26 SetShadowPseudoId(AtomicString("-internal-media-controls-download-button")); |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 | 126 |
| 126 void MediaControlDownloadButtonElement::RecordMetrics( | 127 void MediaControlDownloadButtonElement::RecordMetrics( |
| 127 DownloadActionMetrics metric) { | 128 DownloadActionMetrics metric) { |
| 128 DEFINE_STATIC_LOCAL(EnumerationHistogram, download_action_histogram, | 129 DEFINE_STATIC_LOCAL(EnumerationHistogram, download_action_histogram, |
| 129 ("Media.Controls.Download", | 130 ("Media.Controls.Download", |
| 130 static_cast<int>(DownloadActionMetrics::kCount))); | 131 static_cast<int>(DownloadActionMetrics::kCount))); |
| 131 download_action_histogram.Count(static_cast<int>(metric)); | 132 download_action_histogram.Count(static_cast<int>(metric)); |
| 132 } | 133 } |
| 133 | 134 |
| 134 } // namespace blink | 135 } // namespace blink |
| OLD | NEW |