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 #ifndef SERVICES_WINDOW_MANAGER_WINDOW_MANAGER_APP_H_ | 5 #ifndef SERVICES_WINDOW_MANAGER_WINDOW_MANAGER_APP_H_ |
6 #define SERVICES_WINDOW_MANAGER_WINDOW_MANAGER_APP_H_ | 6 #define SERVICES_WINDOW_MANAGER_WINDOW_MANAGER_APP_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 mojo::ApplicationConnection* connection) override; | 97 mojo::ApplicationConnection* connection) override; |
98 | 98 |
99 private: | 99 private: |
100 // TODO(sky): rename this. Connections is ambiguous. | 100 // TODO(sky): rename this. Connections is ambiguous. |
101 typedef std::set<WindowManagerImpl*> Connections; | 101 typedef std::set<WindowManagerImpl*> Connections; |
102 typedef std::set<mojo::Id> RegisteredViewIdSet; | 102 typedef std::set<mojo::Id> RegisteredViewIdSet; |
103 | 103 |
104 struct PendingEmbed; | 104 struct PendingEmbed; |
105 class WindowManagerInternalImpl; | 105 class WindowManagerInternalImpl; |
106 | 106 |
| 107 mojo::ViewManager* view_manager() { |
| 108 return root_ ? root_->view_manager() : nullptr; |
| 109 } |
| 110 |
107 // Creates an ViewTarget for every view in the hierarchy beneath |view|, | 111 // Creates an ViewTarget for every view in the hierarchy beneath |view|, |
108 // and adds to the registry so that it can be retrieved later via | 112 // and adds to the registry so that it can be retrieved later via |
109 // GetViewTargetForViewId(). | 113 // GetViewTargetForViewId(). |
110 // TODO(beng): perhaps View should have a property bag. | 114 // TODO(beng): perhaps View should have a property bag. |
111 void RegisterSubtree(mojo::View* view); | 115 void RegisterSubtree(mojo::View* view); |
112 | 116 |
113 // Recursively invokes Unregister() for |view| and all its descendants. | 117 // Recursively invokes Unregister() for |view| and all its descendants. |
114 void UnregisterSubtree(mojo::View* view); | 118 void UnregisterSubtree(mojo::View* view); |
115 | 119 |
116 // Deletes the ViewTarget associated with the hierarchy beneath |id|, | 120 // Deletes the ViewTarget associated with the hierarchy beneath |id|, |
117 // and removes from the registry. | 121 // and removes from the registry. |
118 void Unregister(mojo::View* view); | 122 void Unregister(mojo::View* view); |
119 | 123 |
120 // Overridden from ViewManagerDelegate: | 124 // Overridden from ViewManagerDelegate: |
121 void OnEmbed(mojo::ViewManager* view_manager, | 125 void OnEmbed(mojo::View* root, |
122 mojo::View* root, | |
123 mojo::ServiceProviderImpl* exported_services, | 126 mojo::ServiceProviderImpl* exported_services, |
124 scoped_ptr<mojo::ServiceProvider> imported_services) override; | 127 scoped_ptr<mojo::ServiceProvider> imported_services) override; |
125 void OnViewManagerDisconnected(mojo::ViewManager* view_manager) override; | 128 void OnViewManagerDisconnected(mojo::ViewManager* view_manager) override; |
126 | 129 |
127 // Overridden from ViewObserver: | 130 // Overridden from ViewObserver: |
128 void OnTreeChanged(const ViewObserver::TreeChangeParams& params) override; | 131 void OnTreeChanged(const ViewObserver::TreeChangeParams& params) override; |
129 void OnViewDestroying(mojo::View* view) override; | 132 void OnViewDestroying(mojo::View* view) override; |
130 | 133 |
131 // Overridden from ui::EventHandler: | 134 // Overridden from ui::EventHandler: |
132 void OnEvent(ui::Event* event) override; | 135 void OnEvent(ui::Event* event) override; |
(...skipping 26 matching lines...) Expand all Loading... |
159 | 162 |
160 mojo::Shell* shell_; | 163 mojo::Shell* shell_; |
161 | 164 |
162 mojo::InterfaceFactoryImplWithContext<NativeViewportEventDispatcherImpl, | 165 mojo::InterfaceFactoryImplWithContext<NativeViewportEventDispatcherImpl, |
163 WindowManagerApp> | 166 WindowManagerApp> |
164 native_viewport_event_dispatcher_factory_; | 167 native_viewport_event_dispatcher_factory_; |
165 | 168 |
166 ViewManagerDelegate* wrapped_view_manager_delegate_; | 169 ViewManagerDelegate* wrapped_view_manager_delegate_; |
167 WindowManagerDelegate* window_manager_delegate_; | 170 WindowManagerDelegate* window_manager_delegate_; |
168 | 171 |
169 mojo::ViewManager* view_manager_; | |
170 scoped_ptr<mojo::ViewManagerClientFactory> view_manager_client_factory_; | 172 scoped_ptr<mojo::ViewManagerClientFactory> view_manager_client_factory_; |
171 mojo::View* root_; | 173 mojo::View* root_; |
172 | 174 |
173 scoped_ptr<FocusController> focus_controller_; | 175 scoped_ptr<FocusController> focus_controller_; |
174 scoped_ptr<CaptureController> capture_controller_; | 176 scoped_ptr<CaptureController> capture_controller_; |
175 | 177 |
176 Connections connections_; | 178 Connections connections_; |
177 RegisteredViewIdSet registered_view_id_set_; | 179 RegisteredViewIdSet registered_view_id_set_; |
178 | 180 |
179 mojo::WindowManagerInternalClientPtr window_manager_client_; | 181 mojo::WindowManagerInternalClientPtr window_manager_client_; |
180 | 182 |
181 ScopedVector<PendingEmbed> pending_embeds_; | 183 ScopedVector<PendingEmbed> pending_embeds_; |
182 | 184 |
183 scoped_ptr<mojo::ViewManagerClient> view_manager_client_; | 185 scoped_ptr<mojo::ViewManagerClient> view_manager_client_; |
184 | 186 |
185 scoped_ptr<ViewEventDispatcher> view_event_dispatcher_; | 187 scoped_ptr<ViewEventDispatcher> view_event_dispatcher_; |
186 | 188 |
187 scoped_ptr<mojo::Binding<WindowManagerInternal>> wm_internal_binding_; | 189 scoped_ptr<mojo::Binding<WindowManagerInternal>> wm_internal_binding_; |
188 | 190 |
189 DISALLOW_COPY_AND_ASSIGN(WindowManagerApp); | 191 DISALLOW_COPY_AND_ASSIGN(WindowManagerApp); |
190 }; | 192 }; |
191 | 193 |
192 } // namespace window_manager | 194 } // namespace window_manager |
193 | 195 |
194 #endif // SERVICES_WINDOW_MANAGER_WINDOW_MANAGER_APP_H_ | 196 #endif // SERVICES_WINDOW_MANAGER_WINDOW_MANAGER_APP_H_ |
OLD | NEW |