| OLD | NEW |
| 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/frame/FrameOrPlugin.h" | 8 #include "core/frame/FrameOrPlugin.h" |
| 9 #include "core/frame/FrameView.h" | 9 #include "core/frame/FrameView.h" |
| 10 #include "platform/FrameViewBase.h" | |
| 11 #include "platform/geometry/IntRect.h" | 10 #include "platform/geometry/IntRect.h" |
| 12 #include "platform/heap/Handle.h" | 11 #include "platform/heap/Handle.h" |
| 13 | 12 |
| 14 namespace blink { | 13 namespace blink { |
| 15 | 14 |
| 16 class CullRect; | 15 class CullRect; |
| 17 class GraphicsContext; | 16 class GraphicsContext; |
| 18 class RemoteFrame; | 17 class RemoteFrame; |
| 19 | 18 |
| 20 class RemoteFrameView final : public GarbageCollectedFinalized<RemoteFrameView>, | 19 class RemoteFrameView final : public GarbageCollectedFinalized<RemoteFrameView>, |
| 21 public FrameViewBase, | |
| 22 public FrameOrPlugin { | 20 public FrameOrPlugin { |
| 23 USING_GARBAGE_COLLECTED_MIXIN(RemoteFrameView); | 21 USING_GARBAGE_COLLECTED_MIXIN(RemoteFrameView); |
| 24 | 22 |
| 25 public: | 23 public: |
| 26 static RemoteFrameView* Create(RemoteFrame*); | 24 static RemoteFrameView* Create(RemoteFrame*); |
| 27 | 25 |
| 28 ~RemoteFrameView() override; | 26 ~RemoteFrameView() override; |
| 29 | 27 |
| 30 bool IsRemoteFrameView() const override { return true; } | 28 void SetParent(FrameView*) override; |
| 31 void SetParent(FrameViewBase*) override; | 29 FrameView* Parent() const override { return parent_; } |
| 32 FrameViewBase* Parent() const override { return parent_; } | |
| 33 | 30 |
| 34 RemoteFrame& GetFrame() const { | 31 RemoteFrame& GetFrame() const { |
| 35 DCHECK(remote_frame_); | 32 DCHECK(remote_frame_); |
| 36 return *remote_frame_; | 33 return *remote_frame_; |
| 37 } | 34 } |
| 38 | 35 |
| 39 void Dispose() override; | 36 void Dispose() override; |
| 40 // Override to notify remote frame that its viewport size has changed. | 37 // Override to notify remote frame that its viewport size has changed. |
| 41 void FrameRectsChanged() override; | 38 void FrameRectsChanged() override; |
| 42 void InvalidateRect(const IntRect&); | 39 void InvalidateRect(const IntRect&); |
| 43 void SetFrameRect(const IntRect&) override; | 40 void SetFrameRect(const IntRect&) override; |
| 44 const IntRect& FrameRect() const override { return frame_rect_; } | 41 const IntRect& FrameRect() const override { return frame_rect_; } |
| 45 IntPoint Location() const override { return frame_rect_.Location(); } | |
| 46 void Paint(GraphicsContext&, const CullRect&) const override {} | 42 void Paint(GraphicsContext&, const CullRect&) const override {} |
| 47 void Hide() override; | 43 void Hide() override; |
| 48 void Show() override; | 44 void Show() override; |
| 49 void SetParentVisible(bool) override; | 45 void SetParentVisible(bool) override; |
| 50 | 46 |
| 51 IntRect ConvertFromContainingFrameViewBase(const IntRect&) const override; | |
| 52 | |
| 53 void UpdateRemoteViewportIntersection(); | 47 void UpdateRemoteViewportIntersection(); |
| 54 | 48 |
| 55 DECLARE_VIRTUAL_TRACE(); | 49 DECLARE_VIRTUAL_TRACE(); |
| 56 | 50 |
| 57 private: | 51 private: |
| 58 explicit RemoteFrameView(RemoteFrame*); | 52 explicit RemoteFrameView(RemoteFrame*); |
| 59 | 53 |
| 54 IntRect ConvertFromRootFrame(const IntRect&) const; |
| 55 |
| 60 // The properties and handling of the cycle between RemoteFrame | 56 // The properties and handling of the cycle between RemoteFrame |
| 61 // and its RemoteFrameView corresponds to that between LocalFrame | 57 // and its RemoteFrameView corresponds to that between LocalFrame |
| 62 // and FrameView. Please see the FrameView::m_frame comment for | 58 // and FrameView. Please see the FrameView::m_frame comment for |
| 63 // details. | 59 // details. |
| 64 Member<RemoteFrame> remote_frame_; | 60 Member<RemoteFrame> remote_frame_; |
| 65 Member<FrameView> parent_; | 61 Member<FrameView> parent_; |
| 66 IntRect last_viewport_intersection_; | 62 IntRect last_viewport_intersection_; |
| 67 IntRect frame_rect_; | 63 IntRect frame_rect_; |
| 68 bool self_visible_; | 64 bool self_visible_; |
| 69 bool parent_visible_; | 65 bool parent_visible_; |
| 70 }; | 66 }; |
| 71 | 67 |
| 72 DEFINE_TYPE_CASTS(RemoteFrameView, | |
| 73 FrameViewBase, | |
| 74 frameViewBase, | |
| 75 frameViewBase->IsRemoteFrameView(), | |
| 76 frameViewBase.IsRemoteFrameView()); | |
| 77 | |
| 78 } // namespace blink | 68 } // namespace blink |
| 79 | 69 |
| 80 #endif // RemoteFrameView_h | 70 #endif // RemoteFrameView_h |
| OLD | NEW |