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

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

Issue 2812013004: Rewrite references to "wtf/" to "platform/wtf/" in core/{dom,html,xml}. (Closed)
Patch Set: Created 3 years, 8 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 #include "core/dom/ElementVisibilityObserver.h" 5 #include "core/dom/ElementVisibilityObserver.h"
6 6
7 #include "core/dom/Element.h" 7 #include "core/dom/Element.h"
8 #include "core/dom/IntersectionObserverEntry.h" 8 #include "core/dom/IntersectionObserverEntry.h"
9 #include "core/frame/LocalFrame.h" 9 #include "core/frame/LocalFrame.h"
10 #include "wtf/Functional.h" 10 #include "platform/wtf/Functional.h"
11 11
12 namespace blink { 12 namespace blink {
13 13
14 ElementVisibilityObserver::ElementVisibilityObserver( 14 ElementVisibilityObserver::ElementVisibilityObserver(
15 Element* element, 15 Element* element,
16 std::unique_ptr<VisibilityCallback> callback) 16 std::unique_ptr<VisibilityCallback> callback)
17 : element_(element), callback_(std::move(callback)) {} 17 : element_(element), callback_(std::move(callback)) {}
18 18
19 ElementVisibilityObserver::~ElementVisibilityObserver() = default; 19 ElementVisibilityObserver::~ElementVisibilityObserver() = default;
20 20
(...skipping 30 matching lines...) Expand all
51 visitor->Trace(intersection_observer_); 51 visitor->Trace(intersection_observer_);
52 } 52 }
53 53
54 void ElementVisibilityObserver::OnVisibilityChanged( 54 void ElementVisibilityObserver::OnVisibilityChanged(
55 const HeapVector<Member<IntersectionObserverEntry>>& entries) { 55 const HeapVector<Member<IntersectionObserverEntry>>& entries) {
56 bool is_visible = entries.back()->intersectionRatio() > 0.f; 56 bool is_visible = entries.back()->intersectionRatio() > 0.f;
57 (*callback_.get())(is_visible); 57 (*callback_.get())(is_visible);
58 } 58 }
59 59
60 } // namespace blink 60 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/ElementTraversal.h ('k') | third_party/WebKit/Source/core/dom/ExecutionContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698