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

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

Issue 2475643004: Monitor the intersection of video and viewport. (Closed)
Patch Set: Consolidate two ElementVisibilityObserver in AUtoplayUmaHelper. Created 4 years, 1 month 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/ElementVisibilityObserver.h
diff --git a/third_party/WebKit/Source/core/dom/ElementVisibilityObserver.h b/third_party/WebKit/Source/core/dom/ElementVisibilityObserver.h
index c048c2a84ef2acfe3147c12a03e784e2e8c25046..7e6eba6119df86da96ee5e366b4ba0dfea506746 100644
--- a/third_party/WebKit/Source/core/dom/ElementVisibilityObserver.h
+++ b/third_party/WebKit/Source/core/dom/ElementVisibilityObserver.h
@@ -34,10 +34,13 @@ class CORE_EXPORT ElementVisibilityObserver final
virtual ~ElementVisibilityObserver();
void start();
+ void start(const Vector<float>& thresholds);
void stop();
void deliverObservationsForTesting();
+ float ratio() { return m_ratio; }
+
DECLARE_VIRTUAL_TRACE();
private:
@@ -49,6 +52,7 @@ class CORE_EXPORT ElementVisibilityObserver final
Member<Element> m_element;
Member<IntersectionObserver> m_intersectionObserver;
std::unique_ptr<VisibilityCallback> m_callback;
+ float m_ratio = 0;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698