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

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

Issue 413633003: Mojo: Introduces mojo::EventType and mojo::EventFlags (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Landing 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 unified diff | Download patch
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/bind.h" 6 #include "base/bind.h"
7 #include "mojo/examples/keyboard/keyboard.mojom.h" 7 #include "mojo/examples/keyboard/keyboard.mojom.h"
8 #include "mojo/examples/window_manager/debug_panel.h" 8 #include "mojo/examples/window_manager/debug_panel.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/cpp/application/application_connection.h" 10 #include "mojo/public/cpp/application/application_connection.h"
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 } 367 }
368 368
369 // Overridden from WindowManagerDelegate: 369 // Overridden from WindowManagerDelegate:
370 virtual void Embed(const String& url) OVERRIDE { 370 virtual void Embed(const String& url) OVERRIDE {
371 CreateWindow(url, 371 CreateWindow(url,
372 navigation::NavigationDetailsPtr().Pass(), 372 navigation::NavigationDetailsPtr().Pass(),
373 navigation::ResponseDetailsPtr().Pass()); 373 navigation::ResponseDetailsPtr().Pass());
374 } 374 }
375 virtual void DispatchEvent(View* target, EventPtr event) OVERRIDE { 375 virtual void DispatchEvent(View* target, EventPtr event) OVERRIDE {
376 // TODO(beng): More sophisticated focus handling than this is required! 376 // TODO(beng): More sophisticated focus handling than this is required!
377 if (event->action == ui::ET_MOUSE_PRESSED && 377 if (event->action == EVENT_TYPE_MOUSE_PRESSED &&
378 !IsDescendantOfKeyboard(target)) { 378 !IsDescendantOfKeyboard(target)) {
379 target->node()->SetFocus(); 379 target->node()->SetFocus();
380 } 380 }
381 view_manager_->DispatchEvent(target, event.Pass()); 381 view_manager_->DispatchEvent(target, event.Pass());
382 } 382 }
383 383
384 void OnLaunch( 384 void OnLaunch(
385 uint32 source_node_id, 385 uint32 source_node_id,
386 navigation::Target requested_target, 386 navigation::Target requested_target,
387 const mojo::String& handler_url, 387 const mojo::String& handler_url,
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
541 } 541 }
542 542
543 } // namespace examples 543 } // namespace examples
544 544
545 // static 545 // static
546 ApplicationDelegate* ApplicationDelegate::Create() { 546 ApplicationDelegate* ApplicationDelegate::Create() {
547 return new examples::WindowManager; 547 return new examples::WindowManager;
548 } 548 }
549 549
550 } // namespace mojo 550 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/examples/sample_app/gles2_client_impl.cc ('k') | mojo/services/html_viewer/blink_input_events_type_converters.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698