Index: sky/viewer/document_view.cc |
diff --git a/sky/viewer/document_view.cc b/sky/viewer/document_view.cc |
index 6eafdd25a4b579906eb93bf1136268ac2ca0f2f8..5a955b25aca0d5d4e7f535129566b55bdad101b0 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, |
+ const blink::WebRect& bounds) { |
+ if (!root_) |
+ return; |
+ |
+ mojo::View* child = mojo::View::Create(root_->view_manager()); |
+ root_->AddChild(child); |
abarth-chromium
2014/11/06 22:55:07
Do we need to observe child so we can destroy it l
Matt Perry
2014/11/06 23:38:50
I must admit I don't understand the ownership here
Matt Perry
2014/11/07 17:27:40
Sky says we need to delete the children manually,
|
+ mojo::Rect mojo_bounds; |
+ mojo_bounds.x = bounds.x; |
+ mojo_bounds.y = bounds.y; |
+ mojo_bounds.width = bounds.width; |
+ mojo_bounds.height = bounds.height; |
+ 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(); |