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

Unified Diff: third_party/WebKit/Source/core/dom/Document.cpp

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/Document.cpp
diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp
index fd0f51ca7d38f92ec8bf9f4d8e17b4cd052e75c0..0c4358f0011424d7a91626c76919513d6b77f33d 100644
--- a/third_party/WebKit/Source/core/dom/Document.cpp
+++ b/third_party/WebKit/Source/core/dom/Document.cpp
@@ -83,6 +83,7 @@
#include "core/dom/IntersectionObserverController.h"
#include "core/dom/LayoutTreeBuilderTraversal.h"
#include "core/dom/LiveNodeList.h"
+#include "core/dom/MediaIPHManager.h"
#include "core/dom/MutationObserver.h"
#include "core/dom/NodeChildRemovalTracker.h"
#include "core/dom/NodeComputedStyle.h"
@@ -2304,6 +2305,8 @@ void Document::LayoutUpdated() {
}
root_scroller_controller_->DidUpdateLayout();
+ if (media_iph_manager_)
+ media_iph_manager_->LayoutUpdated();
}
void Document::ClearFocusedElementSoon() {
@@ -2677,6 +2680,8 @@ void Document::Shutdown() {
// should be renamed, or this setting of the frame to 0 could be made
// explicit in each of the callers of Document::detachLayoutTree().
frame_ = nullptr;
+
+ media_iph_manager_ = nullptr;
}
void Document::RemoveAllEventListeners() {
@@ -6794,6 +6799,17 @@ CoreProbeSink* Document::GetProbeSink() {
return probe::ToCoreProbeSink(frame);
}
+MediaIPHManager* Document::GetMediaIPHManager() {
+ if (!media_iph_manager_ && GetFrame()) {
+ std::unique_ptr<WebMediaIPH> media_iph(
+ GetFrame()->GetPage()->GetChromeClient().CreateWebMediaIPH(GetFrame()));
+ if (media_iph)
+ media_iph_manager_ = MediaIPHManager::Create(std::move(media_iph));
+ }
+
+ return media_iph_manager_;
+}
+
DEFINE_TRACE(Document) {
visitor->Trace(imports_controller_);
visitor->Trace(doc_type_);
@@ -6850,6 +6866,7 @@ DEFINE_TRACE(Document) {
visitor->Trace(resize_observer_controller_);
visitor->Trace(property_registry_);
visitor->Trace(network_state_observer_);
+ visitor->Trace(media_iph_manager_);
Supplementable<Document>::Trace(visitor);
TreeScope::Trace(visitor);
ContainerNode::Trace(visitor);

Powered by Google App Engine
This is Rietveld 408576698