| Index: sky/viewer/document_view.cc
|
| diff --git a/sky/viewer/document_view.cc b/sky/viewer/document_view.cc
|
| index 6eafdd25a4b579906eb93bf1136268ac2ca0f2f8..dfc7c5f253775dba359a8604f3ae65a9e86a9178 100644
|
| --- a/sky/viewer/document_view.cc
|
| +++ b/sky/viewer/document_view.cc
|
| @@ -151,6 +151,22 @@ blink::WebLayerTreeView* DocumentView::initializeLayerTreeView() {
|
| return web_layer_tree_view_impl_.get();
|
| }
|
|
|
| +void DocumentView::createChildView(const blink::WebURL& url) {
|
| + if (!root_)
|
| + return;
|
| +
|
| + mojo::View* child = mojo::View::Create(root_->view_manager());
|
| + root_->AddChild(child);
|
| + // TODO(mpcomplete): actual bounds.
|
| + mojo::Rect mojo_bounds;
|
| + mojo_bounds.x = 50;
|
| + mojo_bounds.y = 50;
|
| + mojo_bounds.width = 50;
|
| + mojo_bounds.height = 50;
|
| + child->SetBounds(mojo_bounds);
|
| + child->Embed(mojo::String::From(url.string().utf8()));
|
| +}
|
| +
|
| void DocumentView::frameDetached(blink::WebFrame* frame) {
|
| // |frame| is invalid after here.
|
| frame->close();
|
| @@ -206,6 +222,10 @@ void DocumentView::OnViewBoundsChanged(mojo::View* view,
|
|
|
| void DocumentView::OnViewDestroyed(mojo::View* view) {
|
| DCHECK_EQ(view, root_);
|
| +
|
| + for (auto& child : root_->children())
|
| + child->Destroy();
|
| +
|
| delete this;
|
| }
|
|
|
|
|