Chromium Code Reviews| Index: mojo/examples/html_viewer/html_document_view.cc |
| diff --git a/mojo/examples/html_viewer/html_document_view.cc b/mojo/examples/html_viewer/html_document_view.cc |
| index 654161abd64e0fc51d93d9b056e341d985357cc0..99b5552aad2486629fdcf92227b687089304da48 100644 |
| --- a/mojo/examples/html_viewer/html_document_view.cc |
| +++ b/mojo/examples/html_viewer/html_document_view.cc |
| @@ -102,6 +102,8 @@ void HTMLDocumentView::AttachToNode(view_manager::Node* node) { |
| web_view_->setMainFrame(blink::WebLocalFrame::create(this)); |
| web_view_->resize(gfx::Size(node->bounds().size())); |
| + |
| + node->AddObserver(this); |
|
sky
2014/07/14 19:15:27
You need to remove this observer too.
hansmuller
2014/07/14 22:16:42
Done.
|
| } |
| void HTMLDocumentView::Load(URLResponsePtr response) { |
| @@ -184,6 +186,12 @@ void HTMLDocumentView::OnViewInputEvent(view_manager::View* view, |
| web_view_->handleInputEvent(*web_event); |
| } |
| +void HTMLDocumentView::OnNodeBoundsChanged(view_manager::Node* node, |
| + const gfx::Rect&, |
| + const gfx::Rect&) { |
| + web_view_->resize(gfx::Size(node->bounds().size())); |
|
sky
2014/07/14 19:15:27
You don't need the gfx::Size here. node->bounds().
hansmuller
2014/07/14 22:16:42
Done.
|
| +} |
| + |
| void HTMLDocumentView::Repaint() { |
| repaint_pending_ = false; |