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 "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 nested_->Embed(kEmbeddedAppURL); | 94 nested_->Embed(kEmbeddedAppURL); |
95 | 95 |
96 NavigateChild(); | 96 NavigateChild(); |
97 } | 97 } |
98 virtual void OnViewManagerDisconnected(ViewManager* view_manager) OVERRIDE { | 98 virtual void OnViewManagerDisconnected(ViewManager* view_manager) OVERRIDE { |
99 base::MessageLoop::current()->Quit(); | 99 base::MessageLoop::current()->Quit(); |
100 } | 100 } |
101 | 101 |
102 // Overridden from ViewObserver: | 102 // Overridden from ViewObserver: |
103 virtual void OnViewInputEvent(View* view, const EventPtr& event) OVERRIDE { | 103 virtual void OnViewInputEvent(View* view, const EventPtr& event) OVERRIDE { |
104 if (event->action == ui::ET_MOUSE_RELEASED) | 104 if (event->action == EVENT_TYPE_MOUSE_RELEASED) |
105 window_manager_->CloseWindow(view->node()->id()); | 105 window_manager_->CloseWindow(view->node()->id()); |
106 } | 106 } |
107 | 107 |
108 // Overridden from NodeObserver: | 108 // Overridden from NodeObserver: |
109 virtual void OnNodeDestroyed(Node* node) OVERRIDE { | 109 virtual void OnNodeDestroyed(Node* node) OVERRIDE { |
110 // TODO(beng): reap views & child nodes. | 110 // TODO(beng): reap views & child nodes. |
111 nested_ = NULL; | 111 nested_ = NULL; |
112 } | 112 } |
113 | 113 |
114 void NavigateChild() { | 114 void NavigateChild() { |
(...skipping 19 matching lines...) Expand all Loading... |
134 }; | 134 }; |
135 | 135 |
136 } // namespace examples | 136 } // namespace examples |
137 | 137 |
138 // static | 138 // static |
139 ApplicationDelegate* ApplicationDelegate::Create() { | 139 ApplicationDelegate* ApplicationDelegate::Create() { |
140 return new examples::NestingApp; | 140 return new examples::NestingApp; |
141 } | 141 } |
142 | 142 |
143 } // namespace mojo | 143 } // namespace mojo |
OLD | NEW |