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

Unified Diff: sky/viewer/document_view.cc

Issue 682413006: Add a separate call to initialize the bounds for a sky <iframe> element. (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 d34d253f8fe835b3e97aefccbe67a43e5ea38374..1fa7f264ad6ecb6e0ca8a03191ca0ef858fe1984 100644
--- a/sky/viewer/document_view.cc
+++ b/sky/viewer/document_view.cc
@@ -151,20 +151,30 @@ blink::WebLayerTreeView* DocumentView::initializeLayerTreeView() {
return web_layer_tree_view_impl_.get();
}
-void DocumentView::createChildView(const blink::WebURL& url) {
+uint32_t DocumentView::createChildFrame(const blink::WebURL& url) {
if (!root_)
- return;
+ return static_cast<uint32_t>(-1);
esprehn 2014/11/07 21:22:15 It seems wrong to continuously cast -1 to a uint f
Matt Perry 2014/11/10 23:00:56 Switched to using objects instead of IDs.
mojo::View* child = mojo::View::Create(root_->view_manager());
root_->AddChild(child);
- // TODO(mpcomplete): actual bounds.
+ child->Embed(mojo::String::From(url.string().utf8()));
+
+ return child->id();
abarth-chromium 2014/11/07 21:25:50 Why not just return |child| from this function? T
Matt Perry 2014/11/10 23:00:56 I wasn't sure about the layering rules, but that's
+}
+
+void DocumentView::initializeChildFrame(uint32_t frame_id, const blink::WebRect& bounds) {
+ if (!root_)
+ return;
+ mojo::View* child = root_->GetChildById(frame_id);
+ if (!child)
+ return;
+
mojo::Rect mojo_bounds;
- mojo_bounds.x = 0;
- mojo_bounds.y = 50;
- mojo_bounds.width = 300;
- mojo_bounds.height = 100;
+ 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) {
« 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