Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(408)

Side by Side Diff: sky/engine/core/rendering/RenderRemote.cpp

Issue 682413006: Add a separate call to initialize the bounds for a sky <iframe> element. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #include "config.h" 5 #include "config.h"
6 6
7 #include "core/rendering/RenderRemote.h" 7 #include "core/rendering/RenderRemote.h"
8 8
9 #include "core/editing/FrameSelection.h" 9 #include "core/editing/FrameSelection.h"
10 #include "core/frame/LocalFrame.h"
10 #include "core/html/HTMLIFrameElement.h" 11 #include "core/html/HTMLIFrameElement.h"
12 #include "core/loader/FrameLoaderClient.h"
11 #include "core/rendering/PaintInfo.h" 13 #include "core/rendering/PaintInfo.h"
12 #include "platform/geometry/LayoutPoint.h" 14 #include "platform/geometry/LayoutPoint.h"
13 15
14 namespace blink { 16 namespace blink {
15 17
16 RenderRemote::RenderRemote(HTMLIFrameElement* view) 18 RenderRemote::RenderRemote(HTMLIFrameElement* iframe)
17 : RenderReplaced(view) 19 : RenderReplaced(iframe)
18 { 20 {
19 } 21 }
20 22
21 RenderRemote::~RenderRemote() 23 RenderRemote::~RenderRemote()
22 { 24 {
23 } 25 }
24 26
27 void RenderRemote::layout()
28 {
29 RenderReplaced::layout();
30
31 HTMLIFrameElement* frame = static_cast<HTMLIFrameElement*>(node());
esprehn 2014/11/07 21:22:15 toHTMLIframeElement(), use the macros to define th
Matt Perry 2014/11/10 23:00:56 Done.
32 frame->document().frame()->loaderClient()->initializeChildFrame(
33 frame->frame_id(), pixelSnappedIntRect(frameRect()));
abarth-chromium 2014/11/07 21:25:50 "initialize" isn't quite the right term here. It'
Matt Perry 2014/11/10 23:00:56 Done.
34 }
35
25 void RenderRemote::paintReplaced(PaintInfo& paintInfo, 36 void RenderRemote::paintReplaced(PaintInfo& paintInfo,
26 const LayoutPoint& paintOffset) { 37 const LayoutPoint& paintOffset)
38 {
27 // Draw a gray background. This should be painted over by the actual 39 // Draw a gray background. This should be painted over by the actual
28 // content. 40 // content.
29 // TODO(mpcomplete): figure out what we should actually do here. 41 // TODO(mpcomplete): figure out what we should actually do here.
30 GraphicsContext* context = paintInfo.context; 42 GraphicsContext* context = paintInfo.context;
31 43
32 IntRect paintRect = pixelSnappedIntRect(LayoutRect( 44 IntRect paintRect = pixelSnappedIntRect(LayoutRect(
33 paintOffset.x(), paintOffset.y(), contentWidth(), contentHeight())); 45 paintOffset.x(), paintOffset.y(), contentWidth(), contentHeight()));
34 context->setStrokeStyle(SolidStroke); 46 context->setStrokeStyle(SolidStroke);
35 context->setStrokeColor(Color::lightGray); 47 context->setStrokeColor(Color::lightGray);
36 context->setFillColor(Color::darkGray); 48 context->setFillColor(Color::darkGray);
37 context->drawRect(paintRect); 49 context->drawRect(paintRect);
38 } 50 }
39 51
40 } // namespace blink 52 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698