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

Side by Side Diff: third_party/WebKit/Source/core/dom/ElementVisibilityObserver.h

Issue 2051253002: Start autoplay muted videos with autoplay attribute when they are visible. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef ElementVisibilityObserver_h
6 #define ElementVisibilityObserver_h
7
8 #include "core/dom/IntersectionObserver.h"
9 #include "platform/heap/Heap.h"
10 #include "platform/heap/Member.h"
11
12 namespace blink {
13
14 class Element;
15
16 class ElementVisibilityObserver final : public GarbageCollectedFinalized<Element VisibilityObserver>{
17 WTF_MAKE_NONCOPYABLE(ElementVisibilityObserver);
18 public:
19 using VisibilityCallback = Function<void(bool), WTF::SameThreadAffinity>;
20
21 ElementVisibilityObserver(Element*, std::unique_ptr<VisibilityCallback> call back);
22 virtual ~ElementVisibilityObserver();
23
24 void start();
25 void stop();
26
27 DECLARE_VIRTUAL_TRACE();
28
29 private:
30 class ElementVisibilityCallback;
31
32 Member<Element> m_element;
33 std::unique_ptr<VisibilityCallback> m_callback;
34 Member<IntersectionObserver> m_intersectionObserver;
35 Member<ElementVisibilityCallback> m_intersectionObserverCallback;
36 };
37
38 } // namespace blink
39
40 #endif // ElementVisibilityObserver_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698