Index: third_party/WebKit/Source/core/html/shadow/MediaControlsWindowEventListener.h |
diff --git a/third_party/WebKit/Source/core/html/shadow/MediaControlsWindowEventListener.h b/third_party/WebKit/Source/core/html/shadow/MediaControlsWindowEventListener.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..577819da86ceb37ce684c1a2fb6dad623b3c84a9 |
--- /dev/null |
+++ b/third_party/WebKit/Source/core/html/shadow/MediaControlsWindowEventListener.h |
@@ -0,0 +1,47 @@ |
+// Copyright 2016 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 MediaControlsWindowEventListener_h |
+#define MediaControlsWindowEventListener_h |
+ |
+#include "core/events/EventListener.h" |
+#include "wtf/Functional.h" |
+ |
+namespace blink { |
+ |
+class MediaControls; |
+class LocalDOMWindow; |
+ |
+class MediaControlsWindowEventListener final : public EventListener { |
+ public: |
+ using Callback = Function<void(), WTF::SameThreadAffinity>; |
+ |
+ static MediaControlsWindowEventListener* create(MediaControls*, |
+ std::unique_ptr<Callback>); |
+ |
+ bool operator==(const EventListener&) const override; |
+ |
+ void start(); |
+ void stop(); |
+ |
+ DECLARE_VIRTUAL_TRACE(); |
+ |
+ private: |
+ explicit MediaControlsWindowEventListener(MediaControls*, |
+ std::unique_ptr<Callback>); |
+ |
+ void handleEvent(ExecutionContext*, Event*) override; |
+ |
+ void handleClickEvent(); |
+ |
+ LocalDOMWindow* getLocalDOMWindow() const; |
+ |
+ Member<MediaControls> m_mediaControls; |
+ std::unique_ptr<Callback> m_callback; |
+ bool m_isActive; |
+}; |
+ |
+} // namespace blink |
+ |
+#endif // MediaControlsWindowEventListener_h |