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

Side by Side Diff: mojo/examples/browser/browser.cc

Issue 341553002: Remove OnRootRemoved from ViewManagerDelegate (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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/basictypes.h" 5 #include "base/basictypes.h"
6 #include "mojo/public/cpp/application/application.h" 6 #include "mojo/public/cpp/application/application.h"
7 #include "mojo/services/public/cpp/view_manager/node.h" 7 #include "mojo/services/public/cpp/view_manager/node.h"
8 #include "mojo/services/public/cpp/view_manager/view.h" 8 #include "mojo/services/public/cpp/view_manager/view.h"
9 #include "mojo/services/public/cpp/view_manager/view_manager.h" 9 #include "mojo/services/public/cpp/view_manager/view_manager.h"
10 #include "mojo/services/public/cpp/view_manager/view_manager_delegate.h" 10 #include "mojo/services/public/cpp/view_manager/view_manager_delegate.h"
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 view_ = view_manager::View::Create(view_manager_); 120 view_ = view_manager::View::Create(view_manager_);
121 view_manager_->GetRoots().front()->SetActiveView(view_); 121 view_manager_->GetRoots().front()->SetActiveView(view_);
122 122
123 content_node_ = view_manager::Node::Create(view_manager_); 123 content_node_ = view_manager::Node::Create(view_manager_);
124 root->AddChild(content_node_); 124 root->AddChild(content_node_);
125 125
126 root->SetFocus(); 126 root->SetFocus();
127 127
128 CreateWidget(root->bounds().size()); 128 CreateWidget(root->bounds().size());
129 } 129 }
130 virtual void OnRootRemoved(view_manager::ViewManager* view_manager,
131 view_manager::Node* root) OVERRIDE {
132 }
133 130
134 // views::TextfieldController: 131 // views::TextfieldController:
135 virtual bool HandleKeyEvent(views::Textfield* sender, 132 virtual bool HandleKeyEvent(views::Textfield* sender,
136 const ui::KeyEvent& key_event) OVERRIDE { 133 const ui::KeyEvent& key_event) OVERRIDE {
137 if (key_event.key_code() == ui::VKEY_RETURN) { 134 if (key_event.key_code() == ui::VKEY_RETURN) {
138 GURL url(sender->text()); 135 GURL url(sender->text());
139 printf("User entered this URL: %s\n", url.spec().c_str()); 136 printf("User entered this URL: %s\n", url.spec().c_str());
140 launcher_->Launch(url.spec()); 137 launcher_->Launch(url.spec());
141 } 138 }
142 return false; 139 return false;
(...skipping 24 matching lines...) Expand all
167 }; 164 };
168 165
169 } // namespace examples 166 } // namespace examples
170 167
171 // static 168 // static
172 Application* Application::Create() { 169 Application* Application::Create() {
173 return new examples::Browser; 170 return new examples::Browser;
174 } 171 }
175 172
176 } // namespace mojo 173 } // namespace mojo
OLDNEW
« no previous file with comments | « no previous file | mojo/examples/embedded_app/embedded_app.cc » ('j') | mojo/examples/nesting_app/nesting_app.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698