OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |