Index: third_party/WebKit/Source/core/dom/MediaIPHManager.h |
diff --git a/third_party/WebKit/Source/core/dom/MediaIPHManager.h b/third_party/WebKit/Source/core/dom/MediaIPHManager.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..e06bbd16ef7e6e33c042dc775bfd04171307fd29 |
--- /dev/null |
+++ b/third_party/WebKit/Source/core/dom/MediaIPHManager.h |
@@ -0,0 +1,45 @@ |
+// 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 MediaIPHManager_h |
+#define MediaIPHManager_h |
+ |
+#include "core/CoreExport.h" |
+#include "platform/heap/GarbageCollected.h" |
+#include "platform/heap/Heap.h" |
+#include "platform/heap/Member.h" |
+#include "public/web/WebMediaIPH.h" |
+ |
+namespace blink { |
+class HTMLMediaElement; |
+class WebMediaIPH; |
+ |
+class CORE_EXPORT MediaIPHManager final |
chrishtr
2017/06/23 00:39:44
I'm not so sure you need this class at all. Propos
Khushal
2017/06/23 02:11:06
The reason I put it on Document was because I thou
chrishtr
2017/06/27 18:22:20
That sounds like waiting for the browser to me...
Khushal
2017/06/28 05:32:38
Restructured like you suggested except the trackin
|
+ : public GarbageCollectedFinalized<MediaIPHManager>, |
+ public WebMediaIPHClient { |
+ public: |
+ static MediaIPHManager* Create(std::unique_ptr<WebMediaIPH>); |
+ ~MediaIPHManager(); |
+ |
+ DECLARE_TRACE(); |
+ |
+ bool IPHTriggerObservedOnElement(HTMLMediaElement&); |
+ void LayoutUpdated(); |
+ |
+ private: |
+ enum class IPHState { kShowing, kHideRequested, kNotShowing }; |
+ |
+ MediaIPHManager(std::unique_ptr<WebMediaIPH>); |
+ |
+ // WebMediaIPHClient implementation. |
+ void DidHideMediaIPHWidget() override; |
+ |
+ WeakMember<HTMLMediaElement> active_element_; |
+ std::unique_ptr<WebMediaIPH> media_iph_; |
+ IPHState state_ = IPHState::kNotShowing; |
+}; |
+ |
+} // namespace blink |
+ |
+#endif |