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

Unified Diff: sky/viewer/document_view.cc

Issue 708903002: Initial work on a new <view> element backed by a mojo::View. (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 side-by-side diff with in-line comments
Download patch
« sky/engine/web/FrameLoaderClientImpl.cpp ('K') | « sky/viewer/document_view.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« sky/engine/web/FrameLoaderClientImpl.cpp ('K') | « sky/viewer/document_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698