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
3 // found in the LICENSE file.
5 #ifndef RemoteFrameView_h
6 #define RemoteFrameView_h
8 #include "platform/Widget.h"
9 #include "platform/geometry/IntRect.h"
10 #include "platform/heap/Handle.h"
16 class RemoteFrameView : public Widget {
18 static PassRefPtr<RemoteFrameView> create(RemoteFrame*);
20 virtual ~RemoteFrameView();
22 virtual bool isRemoteFrameView() const OVERRIDE { return true; }
24 RemoteFrame& frame() const
26 ASSERT(m_remoteFrame);
27 return *m_remoteFrame;
30 // Override to notify remote frame that its viewport size has changed.
31 virtual void frameRectsChanged() OVERRIDE;
33 virtual void invalidateRect(const IntRect&) OVERRIDE;
35 virtual void setFrameRect(const IntRect&) OVERRIDE;
38 explicit RemoteFrameView(RemoteFrame*);
40 // The RefPtrWillBePersistent-cycle between RemoteFrame and its RemoteFrameView
41 // is broken in the same manner as FrameView::m_frame and LocalFrame::m_view is.
42 // See the FrameView::m_frame comment.
43 RefPtrWillBePersistent<RemoteFrame> m_remoteFrame;
46 DEFINE_TYPE_CASTS(RemoteFrameView, Widget, widget, widget->isRemoteFrameView(), widget.isRemoteFrameView());
50 #endif // RemoteFrameView_h