Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / Source / core / frame / RemoteFrameView.cpp
blob1003baa05b3be3b5b076cc761df9bcbf0512a9d4
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 #include "config.h"
6 #include "core/frame/RemoteFrameView.h"
8 #include "core/frame/RemoteFrame.h"
9 #include "core/layout/LayoutPart.h"
11 namespace blink {
13 RemoteFrameView::RemoteFrameView(RemoteFrame* remoteFrame)
14 : m_remoteFrame(remoteFrame)
16 ASSERT(remoteFrame);
19 RemoteFrameView::~RemoteFrameView()
23 PassRefPtrWillBeRawPtr<RemoteFrameView> RemoteFrameView::create(RemoteFrame* remoteFrame)
25 RefPtrWillBeRawPtr<RemoteFrameView> view = adoptRefWillBeNoop(new RemoteFrameView(remoteFrame));
26 view->show();
27 return view.release();
30 void RemoteFrameView::invalidateRect(const IntRect& rect)
32 LayoutPart* layoutObject = m_remoteFrame->ownerLayoutObject();
33 if (!layoutObject)
34 return;
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)
47 return;
49 Widget::setFrameRect(newRect);
51 frameRectsChanged();
54 void RemoteFrameView::frameRectsChanged()
56 m_remoteFrame->frameRectsChanged(frameRect());
59 DEFINE_TRACE(RemoteFrameView)
61 visitor->trace(m_remoteFrame);
62 Widget::trace(visitor);
65 } // namespace blink