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

Unified Diff: third_party/WebKit/Source/core/dom/MediaIPHManager.h

Issue 2943983003: chrome/blink: Add functionality for in-product help for media elements. (Closed)
Patch Set: Created 3 years, 6 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/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

Powered by Google App Engine
This is Rietveld 408576698