| 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/window_manager/window_manager.mojom.h" | 7 #include "mojo/examples/window_manager/window_manager.mojom.h" |
| 8 #include "mojo/public/cpp/application/application.h" | 8 #include "mojo/public/cpp/application/application.h" |
| 9 #include "mojo/services/public/cpp/view_manager/view.h" | 9 #include "mojo/services/public/cpp/view_manager/view.h" |
| 10 #include "mojo/services/public/cpp/view_manager/view_manager.h" | 10 #include "mojo/services/public/cpp/view_manager/view_manager.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 root->AddChild(nested); | 51 root->AddChild(nested); |
| 52 nested->SetBounds(gfx::Rect(20, 20, 50, 50)); | 52 nested->SetBounds(gfx::Rect(20, 20, 50, 50)); |
| 53 nested->Embed("mojo:mojo_embedded_app"); | 53 nested->Embed("mojo:mojo_embedded_app"); |
| 54 } | 54 } |
| 55 virtual void OnRootRemoved(ViewManager* view_manager, | 55 virtual void OnRootRemoved(ViewManager* view_manager, |
| 56 ViewTreeNode* root) OVERRIDE { | 56 ViewTreeNode* root) OVERRIDE { |
| 57 // TODO(beng): reap views & child nodes. | 57 // TODO(beng): reap views & child nodes. |
| 58 } | 58 } |
| 59 | 59 |
| 60 // Overridden from ViewObserver: | 60 // Overridden from ViewObserver: |
| 61 virtual void OnViewInputEvent(View* view, EventPtr event) OVERRIDE { | 61 virtual void OnViewInputEvent(View* view, const EventPtr& event) OVERRIDE { |
| 62 if (event->action == ui::ET_MOUSE_RELEASED) | 62 if (event->action == ui::ET_MOUSE_RELEASED) |
| 63 window_manager_->CloseWindow(view->node()->id()); | 63 window_manager_->CloseWindow(view->node()->id()); |
| 64 } | 64 } |
| 65 | 65 |
| 66 IWindowManagerPtr window_manager_; | 66 IWindowManagerPtr window_manager_; |
| 67 | 67 |
| 68 DISALLOW_COPY_AND_ASSIGN(NestingApp); | 68 DISALLOW_COPY_AND_ASSIGN(NestingApp); |
| 69 }; | 69 }; |
| 70 | 70 |
| 71 } // namespace examples | 71 } // namespace examples |
| 72 | 72 |
| 73 // static | 73 // static |
| 74 Application* Application::Create() { | 74 Application* Application::Create() { |
| 75 return new examples::NestingApp; | 75 return new examples::NestingApp; |
| 76 } | 76 } |
| 77 | 77 |
| 78 } // namespace mojo | 78 } // namespace mojo |
| OLD | NEW |