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

Side by Side Diff: third_party/WebKit/Source/core/frame/RemoteFrameView.h

Issue 2431473003: Intersection Observer support for OOPIF (Closed)
Patch Set: Fix merge conflict 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 RemoteFrameView_h 5 #ifndef RemoteFrameView_h
6 #define RemoteFrameView_h 6 #define RemoteFrameView_h
7 7
8 #include "core/dom/IntersectionObserver.h"
8 #include "platform/Widget.h" 9 #include "platform/Widget.h"
9 #include "platform/geometry/IntRect.h" 10 #include "platform/geometry/IntRect.h"
10 #include "platform/heap/Handle.h" 11 #include "platform/heap/Handle.h"
11 12
12 namespace blink { 13 namespace blink {
13 14
14 class RemoteFrame; 15 class RemoteFrame;
15 16
16 class RemoteFrameView final : public Widget { 17 class RemoteFrameView final : public Widget {
17 public: 18 public:
18 static RemoteFrameView* create(RemoteFrame*); 19 static RemoteFrameView* create(RemoteFrame*);
19 20
20 ~RemoteFrameView() override; 21 ~RemoteFrameView() override;
21 22
22 bool isRemoteFrameView() const override { return true; } 23 bool isRemoteFrameView() const override { return true; }
23 void setParent(Widget*) override; 24 void setParent(Widget*) override;
24 25
25 RemoteFrame& frame() const { 26 RemoteFrame& frame() const {
26 ASSERT(m_remoteFrame); 27 ASSERT(m_remoteFrame);
27 return *m_remoteFrame; 28 return *m_remoteFrame;
28 } 29 }
29 30
30 void dispose() override; 31 void dispose() override;
31
32 // Override to notify remote frame that its viewport size has changed. 32 // Override to notify remote frame that its viewport size has changed.
33 void frameRectsChanged() override; 33 void frameRectsChanged() override;
34
35 void invalidateRect(const IntRect&) override; 34 void invalidateRect(const IntRect&) override;
36
37 void setFrameRect(const IntRect&) override; 35 void setFrameRect(const IntRect&) override;
38
39 void hide() override; 36 void hide() override;
40 void show() override; 37 void show() override;
41 void setParentVisible(bool) override; 38 void setParentVisible(bool) override;
42 39
43 DECLARE_VIRTUAL_TRACE(); 40 DECLARE_VIRTUAL_TRACE();
44 41
45 private: 42 private:
46 explicit RemoteFrameView(RemoteFrame*); 43 explicit RemoteFrameView(RemoteFrame*);
47 44
45 void onViewportIntersectionChanged(
46 const HeapVector<Member<IntersectionObserverEntry>>&);
47 void startIntersectionObserver();
48 void stopIntersectionObserver();
49
48 // The properties and handling of the cycle between RemoteFrame 50 // The properties and handling of the cycle between RemoteFrame
49 // and its RemoteFrameView corresponds to that between LocalFrame 51 // and its RemoteFrameView corresponds to that between LocalFrame
50 // and FrameView. Please see the FrameView::m_frame comment for 52 // and FrameView. Please see the FrameView::m_frame comment for
51 // details. 53 // details.
52 Member<RemoteFrame> m_remoteFrame; 54 Member<RemoteFrame> m_remoteFrame;
55
56 // An IntersectionObserver is used to monitor the intersection of this
57 // frame with the viewport, which is then forwarded to the remote frame
58 // to enable viewport intersections there to work properly.
59 Member<IntersectionObserver> m_intersectionObserver;
60 IntRect m_lastViewportIntersection;
53 }; 61 };
54 62
55 DEFINE_TYPE_CASTS(RemoteFrameView, 63 DEFINE_TYPE_CASTS(RemoteFrameView,
56 Widget, 64 Widget,
57 widget, 65 widget,
58 widget->isRemoteFrameView(), 66 widget->isRemoteFrameView(),
59 widget.isRemoteFrameView()); 67 widget.isRemoteFrameView());
60 68
61 } // namespace blink 69 } // namespace blink
62 70
63 #endif // RemoteFrameView_h 71 #endif // RemoteFrameView_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698