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.
6 #include "core/frame/RemoteFrameView.h"
8 #include "core/frame/RemoteFrame.h"
9 #include "core/layout/LayoutPart.h"
13 RemoteFrameView::RemoteFrameView(RemoteFrame
* remoteFrame
)
14 : m_remoteFrame(remoteFrame
)
19 RemoteFrameView::~RemoteFrameView()
23 PassRefPtrWillBeRawPtr
<RemoteFrameView
> RemoteFrameView::create(RemoteFrame
* remoteFrame
)
25 RefPtrWillBeRawPtr
<RemoteFrameView
> view
= adoptRefWillBeNoop(new RemoteFrameView(remoteFrame
));
27 return view
.release();
30 void RemoteFrameView::invalidateRect(const IntRect
& rect
)
32 LayoutPart
* layoutObject
= m_remoteFrame
->ownerLayoutObject();
36 LayoutRect
repaintRect(rect
);
37 repaintRect
.move(layoutObject
->borderLeft() + layoutObject
->paddingLeft(),
38 layoutObject
->borderTop() + layoutObject
->paddingTop());
39 layoutObject
->invalidatePaintRectangle(repaintRect
);
42 void RemoteFrameView::setFrameRect(const IntRect
& newRect
)
44 IntRect oldRect
= frameRect();
46 if (newRect
== oldRect
)
49 Widget::setFrameRect(newRect
);
54 void RemoteFrameView::frameRectsChanged()
56 m_remoteFrame
->frameRectsChanged(frameRect());
59 DEFINE_TRACE(RemoteFrameView
)
61 visitor
->trace(m_remoteFrame
);
62 Widget::trace(visitor
);