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 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
360 control_panel_id)); | 360 control_panel_id)); |
361 root->AddObserver(root_layout_manager_.get()); | 361 root->AddObserver(root_layout_manager_.get()); |
362 } | 362 } |
363 virtual void OnViewManagerDisconnected(ViewManager* view_manager) OVERRIDE { | 363 virtual void OnViewManagerDisconnected(ViewManager* view_manager) OVERRIDE { |
364 DCHECK_EQ(view_manager_, view_manager); | 364 DCHECK_EQ(view_manager_, view_manager); |
365 view_manager_ = NULL; | 365 view_manager_ = NULL; |
366 base::MessageLoop::current()->Quit(); | 366 base::MessageLoop::current()->Quit(); |
367 } | 367 } |
368 | 368 |
369 // Overridden from WindowManagerDelegate: | 369 // Overridden from WindowManagerDelegate: |
370 virtual void EmbedRoot(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 == ui::ET_MOUSE_PRESSED && |
378 !IsDescendantOfKeyboard(target)) { | 378 !IsDescendantOfKeyboard(target)) { |
379 target->node()->SetFocus(); | 379 target->node()->SetFocus(); |
380 } | 380 } |
(...skipping 160 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 |