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

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

Issue 2830713003: [Media controls] Add rotate-to-fullscreen gesture behind flag (Closed)
Patch Set: Use __func__ instead per styleguide Created 3 years, 7 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
1 // Copyright 2016 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef ElementVisibilityObserver_h 5 #ifndef ElementVisibilityObserver_h
6 #define ElementVisibilityObserver_h 6 #define ElementVisibilityObserver_h
7 7
8 #include "core/CoreExport.h" 8 #include "core/CoreExport.h"
9 #include "core/dom/IntersectionObserver.h" 9 #include "core/dom/IntersectionObserver.h"
10 #include "platform/heap/Heap.h" 10 #include "platform/heap/Heap.h"
(...skipping 15 matching lines...) Expand all
26 class CORE_EXPORT ElementVisibilityObserver final 26 class CORE_EXPORT ElementVisibilityObserver final
27 : public GarbageCollectedFinalized<ElementVisibilityObserver> { 27 : public GarbageCollectedFinalized<ElementVisibilityObserver> {
28 WTF_MAKE_NONCOPYABLE(ElementVisibilityObserver); 28 WTF_MAKE_NONCOPYABLE(ElementVisibilityObserver);
29 29
30 public: 30 public:
31 using VisibilityCallback = Function<void(bool), WTF::kSameThreadAffinity>; 31 using VisibilityCallback = Function<void(bool), WTF::kSameThreadAffinity>;
32 32
33 ElementVisibilityObserver(Element*, std::unique_ptr<VisibilityCallback>); 33 ElementVisibilityObserver(Element*, std::unique_ptr<VisibilityCallback>);
34 virtual ~ElementVisibilityObserver(); 34 virtual ~ElementVisibilityObserver();
35 35
36 void Start(); 36 // The |threshold| is the minimum fraction that needs to be visible.
37 void Start(float threshold = 0.0);
37 void Stop(); 38 void Stop();
38 39
39 void DeliverObservationsForTesting(); 40 void DeliverObservationsForTesting();
40 41
41 DECLARE_VIRTUAL_TRACE(); 42 DECLARE_VIRTUAL_TRACE();
42 43
43 private: 44 private:
44 class ElementVisibilityCallback; 45 class ElementVisibilityCallback;
45 46
46 void OnVisibilityChanged( 47 void OnVisibilityChanged(
47 const HeapVector<Member<IntersectionObserverEntry>>&); 48 const HeapVector<Member<IntersectionObserverEntry>>&);
48 49
49 Member<Element> element_; 50 Member<Element> element_;
50 Member<IntersectionObserver> intersection_observer_; 51 Member<IntersectionObserver> intersection_observer_;
51 std::unique_ptr<VisibilityCallback> callback_; 52 std::unique_ptr<VisibilityCallback> callback_;
52 }; 53 };
53 54
54 } // namespace blink 55 } // namespace blink
55 56
56 #endif // ElementVisibilityObserver_h 57 #endif // ElementVisibilityObserver_h
OLDNEW
« no previous file with comments | « media/base/media_switches.cc ('k') | third_party/WebKit/Source/core/dom/ElementVisibilityObserver.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698