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

Unified Diff: third_party/WebKit/Source/modules/media_controls/elements/MediaControlCastButtonElement.h

Issue 2782373002: Remove MediaControls methods needed for the Cast button (Closed)
Patch Set: Fixed more tests 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/media_controls/elements/MediaControlCastButtonElement.h
diff --git a/third_party/WebKit/Source/modules/media_controls/elements/MediaControlCastButtonElement.h b/third_party/WebKit/Source/modules/media_controls/elements/MediaControlCastButtonElement.h
index c640a8e01091c018eb116d0ac4552c3963fbad6b..ddde27db43ad49bacd9ec163244c7931fbd92abd 100644
--- a/third_party/WebKit/Source/modules/media_controls/elements/MediaControlCastButtonElement.h
+++ b/third_party/WebKit/Source/modules/media_controls/elements/MediaControlCastButtonElement.h
@@ -16,11 +16,8 @@ class MediaControlCastButtonElement final : public MediaControlInputElement {
public:
MediaControlCastButtonElement(MediaControlsImpl&, bool is_overlay_button);
- // This will show a cast button if it is not covered by another element.
- // This MUST be called for cast button elements that are overlay elements.
- void TryShowOverlay();
-
- void SetIsPlayingRemotely(bool);
+ // Shows/hides the button. Overridden for UMA tracking.
+ void SetIsWanted(bool) override;
// MediaControlInputElement overrides.
bool WillRespondToMouseClickEvents() override;
@@ -28,6 +25,8 @@ class MediaControlCastButtonElement final : public MediaControlInputElement {
bool HasOverflowButton() override;
private:
+ friend class MediaControlsImpl;
+
// This is used for UMA histogram (Cast.Sender.Overlay). New values should
// be appended only and must be added before |Count|.
enum class CastOverlayMetrics {
@@ -40,6 +39,19 @@ class MediaControlCastButtonElement final : public MediaControlInputElement {
void DefaultEventHandler(Event*) override;
bool KeepEventInNode(Event*) override;
+ // Whether the media element is being played remotely at the moment.
+ bool IsPlayingRemotely() const;
+
+ // Returns the element currently layed out under the center of the button.
+ Element* UnderlyingElement();
+
+ // Updates the way the button is displayed (connected or not, overlay or not).
+ void UpdateDisplayType();
+
+ // Returns true if the button can be shown at the moment it's called.
+ // Not const for implementation reasons.
+ bool ShouldShow();
+
void RecordMetrics(CastOverlayMetrics);
bool is_overlay_button_;

Powered by Google App Engine
This is Rietveld 408576698