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 "platform/Widget.h" | 8 #include "platform/Widget.h" |
9 #include "platform/geometry/IntRect.h" | 9 #include "platform/geometry/IntRect.h" |
10 #include "platform/heap/Handle.h" | 10 #include "platform/heap/Handle.h" |
11 | 11 |
12 namespace blink { | 12 namespace blink { |
13 | 13 |
14 class RemoteFrame; | 14 class RemoteFrame; |
15 | 15 |
16 class RemoteFrameView : public Widget { | 16 class RemoteFrameView : public Widget { |
17 public: | 17 public: |
18 static PassRefPtr<RemoteFrameView> create(RemoteFrame*); | 18 static PassRefPtr<RemoteFrameView> create(RemoteFrame*); |
19 | 19 |
20 virtual ~RemoteFrameView(); | 20 virtual ~RemoteFrameView(); |
21 | 21 |
22 virtual bool isRemoteFrameView() const OVERRIDE { return true; } | 22 virtual bool isRemoteFrameView() const OVERRIDE { return true; } |
23 | 23 |
24 RemoteFrame& frame() const { return *m_remoteFrame; } | 24 RemoteFrame& frame() const |
| 25 { |
| 26 ASSERT(m_remoteFrame); |
| 27 return *m_remoteFrame; |
| 28 } |
25 | 29 |
26 // Override to notify remote frame that its viewport size has changed. | 30 // Override to notify remote frame that its viewport size has changed. |
27 virtual void frameRectsChanged() OVERRIDE; | 31 virtual void frameRectsChanged() OVERRIDE; |
28 | 32 |
29 virtual void invalidateRect(const IntRect&) OVERRIDE; | 33 virtual void invalidateRect(const IntRect&) OVERRIDE; |
30 | 34 |
31 virtual void setFrameRect(const IntRect&) OVERRIDE; | 35 virtual void setFrameRect(const IntRect&) OVERRIDE; |
32 | 36 |
33 private: | 37 private: |
34 explicit RemoteFrameView(RemoteFrame*); | 38 explicit RemoteFrameView(RemoteFrame*); |
35 | 39 |
36 // The RefPtrWillBePersistent-cycle between RemoteFrame and its RemoteFrameV
iew | 40 // The RefPtrWillBePersistent-cycle between RemoteFrame and its RemoteFrameV
iew |
37 // is broken in the same manner as FrameView::m_frame and LocalFrame::m_view
is. | 41 // is broken in the same manner as FrameView::m_frame and LocalFrame::m_view
is. |
38 // See the FrameView::m_frame comment. | 42 // See the FrameView::m_frame comment. |
39 RefPtrWillBePersistent<RemoteFrame> m_remoteFrame; | 43 RefPtrWillBePersistent<RemoteFrame> m_remoteFrame; |
40 }; | 44 }; |
41 | 45 |
42 DEFINE_TYPE_CASTS(RemoteFrameView, Widget, widget, widget->isRemoteFrameView(),
widget.isRemoteFrameView()); | 46 DEFINE_TYPE_CASTS(RemoteFrameView, Widget, widget, widget->isRemoteFrameView(),
widget.isRemoteFrameView()); |
43 | 47 |
44 } // namespace blink | 48 } // namespace blink |
45 | 49 |
46 #endif // RemoteFrameView_h | 50 #endif // RemoteFrameView_h |
OLD | NEW |