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

Unified Diff: mojo/examples/html_viewer/html_document_view.cc

Issue 383123006: Preliminary interactive layout of window manager's demo_launcher (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Resize KeyboardManager, sync Created 6 years, 5 months 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
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;

Powered by Google App Engine
This is Rietveld 408576698