Matt Perry 694cabc454 Initial work on a new <view> element backed by a mojo::View.
This CL introduces an HTMLViewElement which, when inserted into a document,
causes a mojo::View to be created and navigated to the provided URL. No
compositing is done, but the view manager handles the rendering (as I
understand it).

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/708903002
2014-11-07 14:34:07 -05:00

41 lines
1.2 KiB
C++

// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "config.h"
#include "core/rendering/RenderRemote.h"
#include "core/editing/FrameSelection.h"
#include "core/html/HTMLIFrameElement.h"
#include "core/rendering/PaintInfo.h"
#include "platform/geometry/LayoutPoint.h"
namespace blink {
RenderRemote::RenderRemote(HTMLIFrameElement* view)
: RenderReplaced(view)
{
}
RenderRemote::~RenderRemote()
{
}
void RenderRemote::paintReplaced(PaintInfo& paintInfo,
const LayoutPoint& paintOffset) {
// Draw a gray background. This should be painted over by the actual
// content.
// TODO(mpcomplete): figure out what we should actually do here.
GraphicsContext* context = paintInfo.context;
IntRect paintRect = pixelSnappedIntRect(LayoutRect(
paintOffset.x(), paintOffset.y(), contentWidth(), contentHeight()));
context->setStrokeStyle(SolidStroke);
context->setStrokeColor(Color::lightGray);
context->setFillColor(Color::darkGray);
context->drawRect(paintRect);
}
} // namespace blink