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

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

Issue 549273002: Various mojom cleanup from ContentHandler changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: gn Created 6 years, 3 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
« no previous file with comments | « no previous file | mojo/examples/embedded_app/embedded_app.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "base/strings/string_util.h" 6 #include "base/strings/string_util.h"
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "mojo/common/common_type_converters.h" 8 #include "mojo/common/common_type_converters.h"
9 #include "mojo/examples/window_manager/window_manager.mojom.h" 9 #include "mojo/examples/window_manager/window_manager.mojom.h"
10 #include "mojo/public/c/system/main.h" 10 #include "mojo/public/c/system/main.h"
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 view_manager_ = NULL; 222 view_manager_ = NULL;
223 base::MessageLoop::current()->Quit(); 223 base::MessageLoop::current()->Quit();
224 } 224 }
225 225
226 // views::TextfieldController: 226 // views::TextfieldController:
227 virtual bool HandleKeyEvent(views::Textfield* sender, 227 virtual bool HandleKeyEvent(views::Textfield* sender,
228 const ui::KeyEvent& key_event) OVERRIDE { 228 const ui::KeyEvent& key_event) OVERRIDE {
229 if (key_event.key_code() == ui::VKEY_RETURN) { 229 if (key_event.key_code() == ui::VKEY_RETURN) {
230 GURL url(sender->text()); 230 GURL url(sender->text());
231 printf("User entered this URL: %s\n", url.spec().c_str()); 231 printf("User entered this URL: %s\n", url.spec().c_str());
232 NavigationDetailsPtr nav_details(NavigationDetails::New()); 232 URLRequestPtr request(URLRequest::New());
233 nav_details->request->url = String::From(url); 233 request->url = String::From(url);
234 navigator_host_->RequestNavigate(TARGET_NEW_NODE, nav_details.Pass()); 234 navigator_host_->RequestNavigate(TARGET_NEW_NODE, request.Pass());
235 } 235 }
236 return false; 236 return false;
237 } 237 }
238 238
239 // ViewObserver: 239 // ViewObserver:
240 virtual void OnViewFocusChanged(View* gained_focus, 240 virtual void OnViewFocusChanged(View* gained_focus,
241 View* lost_focus) OVERRIDE { 241 View* lost_focus) OVERRIDE {
242 aura::client::FocusClient* focus_client = 242 aura::client::FocusClient* focus_client =
243 aura::client::GetFocusClient(widget_->GetNativeView()); 243 aura::client::GetFocusClient(widget_->GetNativeView());
244 if (lost_focus == root_) 244 if (lost_focus == root_)
(...skipping 19 matching lines...) Expand all
264 DISALLOW_COPY_AND_ASSIGN(Browser); 264 DISALLOW_COPY_AND_ASSIGN(Browser);
265 }; 265 };
266 266
267 } // namespace examples 267 } // namespace examples
268 } // namespace mojo 268 } // namespace mojo
269 269
270 MojoResult MojoMain(MojoHandle shell_handle) { 270 MojoResult MojoMain(MojoHandle shell_handle) {
271 mojo::ApplicationRunnerChromium runner(new mojo::examples::Browser); 271 mojo::ApplicationRunnerChromium runner(new mojo::examples::Browser);
272 return runner.Run(shell_handle); 272 return runner.Run(shell_handle);
273 } 273 }
OLDNEW
« no previous file with comments | « no previous file | mojo/examples/embedded_app/embedded_app.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698