| 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
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..c640a8e01091c018eb116d0ac4552c3963fbad6b
|
| --- /dev/null
|
| +++ b/third_party/WebKit/Source/modules/media_controls/elements/MediaControlCastButtonElement.h
|
| @@ -0,0 +1,55 @@
|
| +// Copyright 2017 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef MediaControlCastButtonElement_h
|
| +#define MediaControlCastButtonElement_h
|
| +
|
| +#include "core/html/shadow/MediaControlElementTypes.h"
|
| +
|
| +namespace blink {
|
| +
|
| +class Event;
|
| +class MediaControlsImpl;
|
| +
|
| +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);
|
| +
|
| + // MediaControlInputElement overrides.
|
| + bool WillRespondToMouseClickEvents() override;
|
| + WebLocalizedString::Name GetOverflowStringName() override;
|
| + bool HasOverflowButton() override;
|
| +
|
| + private:
|
| + // This is used for UMA histogram (Cast.Sender.Overlay). New values should
|
| + // be appended only and must be added before |Count|.
|
| + enum class CastOverlayMetrics {
|
| + kCreated = 0,
|
| + kShown,
|
| + kClicked,
|
| + kCount // Keep last.
|
| + };
|
| +
|
| + void DefaultEventHandler(Event*) override;
|
| + bool KeepEventInNode(Event*) override;
|
| +
|
| + void RecordMetrics(CastOverlayMetrics);
|
| +
|
| + bool is_overlay_button_;
|
| +
|
| + // UMA related boolean. They are used to prevent counting something twice
|
| + // for the same media element.
|
| + bool click_use_counted_ = false;
|
| + bool show_use_counted_ = false;
|
| +};
|
| +
|
| +} // namespace blink
|
| +
|
| +#endif // MediaControlCastButtonElement_h
|
|
|