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

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: more review comments 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/core/html/HTMLIFrameElement.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..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;
}
« sky/engine/core/html/HTMLIFrameElement.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