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

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

Issue 341953002: Clean up WTH creation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 6 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
« no previous file with comments | « mojo/examples/aura_demo/aura_demo.cc ('k') | mojo/mojo_examples.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/examples/browser/browser.cc
diff --git a/mojo/examples/browser/browser.cc b/mojo/examples/browser/browser.cc
index f784c0d8a6fe10cd6a4b10aff636809d46b272ec..597ed51cb4d8a37a8dab9fd376cf91654138367d 100644
--- a/mojo/examples/browser/browser.cc
+++ b/mojo/examples/browser/browser.cc
@@ -52,7 +52,7 @@ class Browser : public Application,
public view_manager::ViewManagerDelegate,
public views::TextfieldController {
public:
- Browser() : view_manager_(NULL), view_(NULL) {}
+ Browser() : view_manager_(NULL) {}
virtual ~Browser() {
}
@@ -65,7 +65,7 @@ class Browser : public Application,
ConnectTo("mojo:mojo_window_manager", &navigator_host_);
}
- void CreateWidget(const gfx::Size& size) {
+ void CreateWidget(view_manager::Node* node) {
views::Textfield* textfield = new views::Textfield;
textfield->set_controller(this);
@@ -77,9 +77,9 @@ class Browser : public Application,
views::Widget* widget = new views::Widget;
views::Widget::InitParams params(
views::Widget::InitParams::TYPE_WINDOW_FRAMELESS);
- params.native_widget = new NativeWidgetViewManager(widget, view_);
+ params.native_widget = new NativeWidgetViewManager(widget, node);
params.delegate = widget_delegate;
- params.bounds = gfx::Rect(size.width(), size.height());
+ params.bounds = gfx::Rect(node->bounds().width(), node->bounds().height());
widget->Init(params);
widget->Show();
textfield->RequestFocus();
@@ -90,10 +90,9 @@ class Browser : public Application,
view_manager::Node* root) OVERRIDE {
// TODO: deal with OnRootAdded() being invoked multiple times.
view_manager_ = view_manager;
- view_ = view_manager::View::Create(view_manager_);
- view_manager_->GetRoots().front()->SetActiveView(view_);
+ root->SetActiveView(view_manager::View::Create(view_manager));
root->SetFocus();
- CreateWidget(root->bounds().size());
+ CreateWidget(root);
}
// views::TextfieldController:
@@ -124,7 +123,6 @@ class Browser : public Application,
scoped_ptr<ViewsInit> views_init_;
view_manager::ViewManager* view_manager_;
- view_manager::View* view_;
navigation::NavigatorHostPtr navigator_host_;
DISALLOW_COPY_AND_ASSIGN(Browser);
« no previous file with comments | « mojo/examples/aura_demo/aura_demo.cc ('k') | mojo/mojo_examples.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698