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

Unified Diff: mojo/examples/browser/browser.cc

Issue 383123006: Preliminary interactive layout of window manager's demo_launcher (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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/browser/browser.cc
diff --git a/mojo/examples/browser/browser.cc b/mojo/examples/browser/browser.cc
index 1474556d6044f46acf2006a5204eed44a375e30b..0fd932acc2be4a7ccc4a423998fd0d0c1ef10f97 100644
--- a/mojo/examples/browser/browser.cc
+++ b/mojo/examples/browser/browser.cc
@@ -175,11 +175,11 @@ class Browser : public ApplicationDelegate,
textfield->set_controller(this);
views::WidgetDelegateView* widget_delegate = new views::WidgetDelegateView;
- widget_delegate->GetContentsView()->set_background(
+ contents_view_ = widget_delegate->GetContentsView();
+ contents_view_->set_background(
views::Background::CreateSolidBackground(SK_ColorBLUE));
- widget_delegate->GetContentsView()->AddChildView(textfield);
- widget_delegate->GetContentsView()->SetLayoutManager(
- new BrowserLayoutManager);
+ contents_view_->AddChildView(textfield);
+ contents_view_->SetLayoutManager(new BrowserLayoutManager);
widget_ = new views::Widget;
views::Widget::InitParams params(
@@ -233,11 +233,19 @@ class Browser : public ApplicationDelegate,
focus_client->FocusWindow(widget_->GetNativeView());
}
+ virtual void OnNodeBoundsChanged(view_manager::Node* node,
+ const gfx::Rect& /*old_bounds*/,
sky 2014/07/11 18:19:46 We generally don't use this style in chrome code.
+ const gfx::Rect& /*new_bounds*/) OVERRIDE {
+ widget_->SetBounds(gfx::Rect(node->bounds().size()));
sky 2014/07/11 18:19:46 NativeWidgetViewManager is a NodeObserver. It shou
+ contents_view_->Layout();
sky 2014/07/11 18:19:46 This should happen automatically as a result of se
+ }
+
scoped_ptr<ViewsInit> views_init_;
view_manager::ViewManager* view_manager_;
view_manager::Node* root_;
views::Widget* widget_;
+ views::View* contents_view_;
sky 2014/07/11 18:19:46 initialize this to NULL in the member initializer
navigation::NavigatorHostPtr navigator_host_;
IWindowManagerPtr window_manager_;
« no previous file with comments | « no previous file | mojo/examples/window_manager/debug_panel.h » ('j') | mojo/examples/window_manager/window_manager.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698