Chromium Code Reviews| 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) { |