| OLD | NEW |
| (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 MediaControlCastButtonElement_h |
| 6 #define MediaControlCastButtonElement_h |
| 7 |
| 8 #include "core/html/shadow/MediaControlElementTypes.h" |
| 9 |
| 10 namespace blink { |
| 11 |
| 12 class Event; |
| 13 class MediaControlsImpl; |
| 14 |
| 15 class MediaControlCastButtonElement final : public MediaControlInputElement { |
| 16 public: |
| 17 MediaControlCastButtonElement(MediaControlsImpl&, bool is_overlay_button); |
| 18 |
| 19 // This will show a cast button if it is not covered by another element. |
| 20 // This MUST be called for cast button elements that are overlay elements. |
| 21 void TryShowOverlay(); |
| 22 |
| 23 void SetIsPlayingRemotely(bool); |
| 24 |
| 25 // MediaControlInputElement overrides. |
| 26 bool WillRespondToMouseClickEvents() override; |
| 27 WebLocalizedString::Name GetOverflowStringName() override; |
| 28 bool HasOverflowButton() override; |
| 29 |
| 30 private: |
| 31 // This is used for UMA histogram (Cast.Sender.Overlay). New values should |
| 32 // be appended only and must be added before |Count|. |
| 33 enum class CastOverlayMetrics { |
| 34 kCreated = 0, |
| 35 kShown, |
| 36 kClicked, |
| 37 kCount // Keep last. |
| 38 }; |
| 39 |
| 40 void DefaultEventHandler(Event*) override; |
| 41 bool KeepEventInNode(Event*) override; |
| 42 |
| 43 void RecordMetrics(CastOverlayMetrics); |
| 44 |
| 45 bool is_overlay_button_; |
| 46 |
| 47 // UMA related boolean. They are used to prevent counting something twice |
| 48 // for the same media element. |
| 49 bool click_use_counted_ = false; |
| 50 bool show_use_counted_ = false; |
| 51 }; |
| 52 |
| 53 } // namespace blink |
| 54 |
| 55 #endif // MediaControlCastButtonElement_h |
| OLD | NEW |