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

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLMediaElement.h

Issue 1700743003: Record whether and why the media default controls are being shown. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@media-controls-usecount
Patch Set: review comments Created 4 years, 10 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/HTMLMediaElement.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 class WebInbandTextTrack; 61 class WebInbandTextTrack;
62 class WebLayer; 62 class WebLayer;
63 63
64 class CORE_EXPORT HTMLMediaElement : public HTMLElement, public WillBeHeapSupple mentable<HTMLMediaElement>, public ActiveDOMObject, private WebMediaPlayerClient { 64 class CORE_EXPORT HTMLMediaElement : public HTMLElement, public WillBeHeapSupple mentable<HTMLMediaElement>, public ActiveDOMObject, private WebMediaPlayerClient {
65 DEFINE_WRAPPERTYPEINFO(); 65 DEFINE_WRAPPERTYPEINFO();
66 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(HTMLMediaElement); 66 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(HTMLMediaElement);
67 WILL_BE_USING_PRE_FINALIZER(HTMLMediaElement, dispose); 67 WILL_BE_USING_PRE_FINALIZER(HTMLMediaElement, dispose);
68 public: 68 public:
69 static WebMimeRegistry::SupportsType supportsType(const ContentType&); 69 static WebMimeRegistry::SupportsType supportsType(const ContentType&);
70 70
71 enum class RecordMetricsBehavior {
72 DoNotRecord,
73 DoRecord
74 };
75
71 static void setMediaStreamRegistry(URLRegistry*); 76 static void setMediaStreamRegistry(URLRegistry*);
72 static bool isMediaStreamURL(const String& url); 77 static bool isMediaStreamURL(const String& url);
73 78
74 DECLARE_VIRTUAL_TRACE(); 79 DECLARE_VIRTUAL_TRACE();
75 void clearWeakMembers(Visitor*); 80 void clearWeakMembers(Visitor*);
76 WebMediaPlayer* webMediaPlayer() const 81 WebMediaPlayer* webMediaPlayer() const
77 { 82 {
78 return m_webMediaPlayer.get(); 83 return m_webMediaPlayer.get();
79 } 84 }
80 85
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 bool paused() const; 130 bool paused() const;
126 double defaultPlaybackRate() const; 131 double defaultPlaybackRate() const;
127 void setDefaultPlaybackRate(double); 132 void setDefaultPlaybackRate(double);
128 double playbackRate() const; 133 double playbackRate() const;
129 void setPlaybackRate(double); 134 void setPlaybackRate(double);
130 void updatePlaybackRate(); 135 void updatePlaybackRate();
131 TimeRanges* played(); 136 TimeRanges* played();
132 TimeRanges* seekable() const; 137 TimeRanges* seekable() const;
133 bool ended() const; 138 bool ended() const;
134 bool autoplay() const; 139 bool autoplay() const;
135 enum class RecordMetricsBehavior { DoNotRecord, DoRecord };
136 bool shouldAutoplay(const RecordMetricsBehavior = RecordMetricsBehavior::DoN otRecord); 140 bool shouldAutoplay(const RecordMetricsBehavior = RecordMetricsBehavior::DoN otRecord);
137 bool loop() const; 141 bool loop() const;
138 void setLoop(bool); 142 void setLoop(bool);
139 void play(); 143 void play();
140 void pause(); 144 void pause();
141 void requestRemotePlayback(); 145 void requestRemotePlayback();
142 void requestRemotePlaybackControl(); 146 void requestRemotePlaybackControl();
143 147
144 // statistics 148 // statistics
145 unsigned webkitAudioDecodedByteCount() const; 149 unsigned webkitAudioDecodedByteCount() const;
146 unsigned webkitVideoDecodedByteCount() const; 150 unsigned webkitVideoDecodedByteCount() const;
147 151
148 // media source extensions 152 // media source extensions
149 void closeMediaSource(); 153 void closeMediaSource();
150 void durationChanged(double duration, bool requestSeek); 154 void durationChanged(double duration, bool requestSeek);
151 155
152 // controls 156 // controls
153 bool shouldShowControls() const; 157 bool shouldShowControls(const RecordMetricsBehavior = RecordMetricsBehavior: :DoNotRecord) const;
154 double volume() const; 158 double volume() const;
155 void setVolume(double, ExceptionState&); 159 void setVolume(double, ExceptionState&);
156 bool muted() const; 160 bool muted() const;
157 void setMuted(bool); 161 void setMuted(bool);
158 162
159 void togglePlayState(); 163 void togglePlayState();
160 164
161 AudioTrackList& audioTracks(); 165 AudioTrackList& audioTracks();
162 void audioTrackChanged(); 166 void audioTrackChanged();
163 167
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after
620 inline bool isHTMLMediaElement(const HTMLElement& element) 624 inline bool isHTMLMediaElement(const HTMLElement& element)
621 { 625 {
622 return isHTMLAudioElement(element) || isHTMLVideoElement(element); 626 return isHTMLAudioElement(element) || isHTMLVideoElement(element);
623 } 627 }
624 628
625 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLMediaElement); 629 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLMediaElement);
626 630
627 } // namespace blink 631 } // namespace blink
628 632
629 #endif // HTMLMediaElement_h 633 #endif // HTMLMediaElement_h
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/HTMLMediaElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698