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

Side by Side Diff: third_party/WebKit/Source/modules/media_controls/elements/MediaControlDownloadButtonElement.h

Issue 2813103006: Media Controls: move last buttons to modules/. (Closed)
Patch Set: Created 3 years, 8 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 unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef MediaControlDownloadButtonElement_h
6 #define MediaControlDownloadButtonElement_h
7
8 #include "core/html/shadow/MediaControlElementTypes.h"
9
10 namespace blink {
11
12 class Event;
13 class MediaControlsImpl;
14
15 class MediaControlDownloadButtonElement final
16 : public MediaControlInputElement {
17 public:
18 explicit MediaControlDownloadButtonElement(MediaControlsImpl&);
19
20 // Returns true if the download button should be shown. We should
21 // show the button for only non-MSE, non-EME, and non-MediaStream content.
22 bool ShouldDisplayDownloadButton();
23
24 // MediaControlInputElement overrides.
25 // TODO(mlamouri): add WillRespondToMouseClickEvents
26 WebLocalizedString::Name GetOverflowStringName() override;
27 bool HasOverflowButton() override;
28 void SetIsWanted(bool) override;
29
30 DECLARE_VIRTUAL_TRACE();
31
32 private:
33 // This is used for UMA histogram (Media.Controls.Download). New values should
34 // be appended only and must be added before |Count|.
35 enum class DownloadActionMetrics {
36 kShown = 0,
37 kClicked,
38 kCount // Keep last.
39 };
40
41 void DefaultEventHandler(Event*) override;
42
43 void RecordMetrics(DownloadActionMetrics);
44
45 // Points to an anchor element that contains the URL of the media file.
46 Member<HTMLAnchorElement> anchor_;
47
48 // UMA related boolean. They are used to prevent counting something twice
49 // for the same media element.
50 bool click_use_counted_ = false;
51 bool show_use_counted_ = false;
52 };
53
54 } // namespace blink
55
56 #endif // MediaControlDownloadButtonElement_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698