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" |
11 #include "base/memory/scoped_vector.h" | 11 #include "base/memory/scoped_vector.h" |
12 #include "mojo/public/cpp/application/application_delegate.h" | 12 #include "mojo/public/cpp/application/application_delegate.h" |
13 #include "mojo/public/cpp/application/interface_factory_impl.h" | 13 #include "mojo/public/cpp/application/interface_factory_impl.h" |
14 #include "mojo/public/cpp/bindings/binding.h" | 14 #include "mojo/public/cpp/bindings/binding.h" |
15 #include "mojo/public/cpp/bindings/string.h" | 15 #include "mojo/public/cpp/bindings/string.h" |
16 #include "mojo/services/view_manager/public/cpp/types.h" | 16 #include "mojo/services/view_manager/public/cpp/types.h" |
17 #include "mojo/services/view_manager/public/cpp/view_manager_client_factory.h" | 17 #include "mojo/services/view_manager/public/cpp/view_manager_client_factory.h" |
18 #include "mojo/services/view_manager/public/cpp/view_manager_delegate.h" | 18 #include "mojo/services/view_manager/public/cpp/view_manager_delegate.h" |
19 #include "mojo/services/view_manager/public/cpp/view_observer.h" | 19 #include "mojo/services/view_manager/public/cpp/view_observer.h" |
20 #include "mojo/services/window_manager/public/interfaces/window_manager_internal
.mojom.h" | 20 #include "mojo/services/window_manager/public/interfaces/window_manager_internal
.mojom.h" |
21 #include "services/window_manager/capture_controller_observer.h" | 21 #include "services/window_manager/capture_controller_observer.h" |
22 #include "services/window_manager/focus_controller_observer.h" | 22 #include "services/window_manager/focus_controller_observer.h" |
23 #include "services/window_manager/native_viewport_event_dispatcher_impl.h" | 23 #include "services/window_manager/native_viewport_event_dispatcher_impl.h" |
24 #include "services/window_manager/view_target.h" | 24 #include "services/window_manager/view_target.h" |
25 #include "services/window_manager/window_manager_impl.h" | 25 #include "services/window_manager/window_manager_impl.h" |
26 #include "ui/events/event_handler.h" | 26 #include "ui/events/event_handler.h" |
| 27 #include "ui/events/gestures/gesture_provider_impl.h" |
27 | 28 |
28 namespace gfx { | 29 namespace gfx { |
29 class Size; | 30 class Size; |
30 } | 31 } |
31 | 32 |
32 namespace window_manager { | 33 namespace window_manager { |
33 | 34 |
34 class CaptureController; | 35 class CaptureController; |
35 class FocusController; | 36 class FocusController; |
36 class FocusRules; | 37 class FocusRules; |
37 class ViewEventDispatcher; | 38 class ViewEventDispatcher; |
38 class WindowManagerClient; | 39 class WindowManagerClient; |
39 class WindowManagerDelegate; | 40 class WindowManagerDelegate; |
40 class WindowManagerImpl; | 41 class WindowManagerImpl; |
41 | 42 |
42 // Implements core window manager functionality that could conceivably be shared | 43 // Implements core window manager functionality that could conceivably be shared |
43 // across multiple window managers implementing superficially different user | 44 // across multiple window managers implementing superficially different user |
44 // experiences. Establishes communication with the view manager. | 45 // experiences. Establishes communication with the view manager. |
45 // A window manager wishing to use this core should create and own an instance | 46 // A window manager wishing to use this core should create and own an instance |
46 // of this object. They may implement the associated ViewManager/WindowManager | 47 // of this object. They may implement the associated ViewManager/WindowManager |
47 // delegate interfaces exposed by the view manager, this object provides the | 48 // delegate interfaces exposed by the view manager, this object provides the |
48 // canonical implementation of said interfaces but will call out to the wrapped | 49 // canonical implementation of said interfaces but will call out to the wrapped |
49 // instances. | 50 // instances. |
50 class WindowManagerApp | 51 class WindowManagerApp |
51 : public mojo::ApplicationDelegate, | 52 : public mojo::ApplicationDelegate, |
52 public mojo::ViewManagerDelegate, | 53 public mojo::ViewManagerDelegate, |
53 public mojo::ViewObserver, | 54 public mojo::ViewObserver, |
54 public ui::EventHandler, | 55 public ui::EventHandler, |
| 56 public ui::GestureProviderImplClient, |
55 public FocusControllerObserver, | 57 public FocusControllerObserver, |
56 public CaptureControllerObserver, | 58 public CaptureControllerObserver, |
57 public mojo::InterfaceFactory<mojo::WindowManager>, | 59 public mojo::InterfaceFactory<mojo::WindowManager>, |
58 public mojo::InterfaceFactory<mojo::WindowManagerInternal>, | 60 public mojo::InterfaceFactory<mojo::WindowManagerInternal>, |
59 public mojo::WindowManagerInternal { | 61 public mojo::WindowManagerInternal { |
60 public: | 62 public: |
61 WindowManagerApp(ViewManagerDelegate* view_manager_delegate, | 63 WindowManagerApp(ViewManagerDelegate* view_manager_delegate, |
62 WindowManagerDelegate* window_manager_delegate); | 64 WindowManagerDelegate* window_manager_delegate); |
63 ~WindowManagerApp() override; | 65 ~WindowManagerApp() override; |
64 | 66 |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 scoped_ptr<mojo::ServiceProvider> imported_services) override; | 129 scoped_ptr<mojo::ServiceProvider> imported_services) override; |
128 void OnViewManagerDisconnected(mojo::ViewManager* view_manager) override; | 130 void OnViewManagerDisconnected(mojo::ViewManager* view_manager) override; |
129 | 131 |
130 // Overridden from ViewObserver: | 132 // Overridden from ViewObserver: |
131 void OnTreeChanged(const ViewObserver::TreeChangeParams& params) override; | 133 void OnTreeChanged(const ViewObserver::TreeChangeParams& params) override; |
132 void OnViewDestroying(mojo::View* view) override; | 134 void OnViewDestroying(mojo::View* view) override; |
133 | 135 |
134 // Overridden from ui::EventHandler: | 136 // Overridden from ui::EventHandler: |
135 void OnEvent(ui::Event* event) override; | 137 void OnEvent(ui::Event* event) override; |
136 | 138 |
| 139 // Overridden from ui::GestureProviderImplClient: |
| 140 void OnGestureEvent(ui::GestureEvent* event) override; |
| 141 |
137 // Overridden from mojo::FocusControllerObserver: | 142 // Overridden from mojo::FocusControllerObserver: |
138 void OnViewFocused(mojo::View* gained_focus, mojo::View* lost_focus) override; | 143 void OnViewFocused(mojo::View* gained_focus, mojo::View* lost_focus) override; |
139 void OnViewActivated(mojo::View* gained_active, | 144 void OnViewActivated(mojo::View* gained_active, |
140 mojo::View* lost_active) override; | 145 mojo::View* lost_active) override; |
141 | 146 |
142 // Overridden from mojo::CaptureControllerObserver: | 147 // Overridden from mojo::CaptureControllerObserver: |
143 void OnCaptureChanged(mojo::View* gained_capture, | 148 void OnCaptureChanged(mojo::View* gained_capture, |
144 mojo::View* lost_capture) override; | 149 mojo::View* lost_capture) override; |
145 | 150 |
146 // Creates the connection to the ViewManager. | 151 // Creates the connection to the ViewManager. |
(...skipping 18 matching lines...) Expand all Loading... |
165 mojo::InterfaceFactoryImplWithContext<NativeViewportEventDispatcherImpl, | 170 mojo::InterfaceFactoryImplWithContext<NativeViewportEventDispatcherImpl, |
166 WindowManagerApp> | 171 WindowManagerApp> |
167 native_viewport_event_dispatcher_factory_; | 172 native_viewport_event_dispatcher_factory_; |
168 | 173 |
169 ViewManagerDelegate* wrapped_view_manager_delegate_; | 174 ViewManagerDelegate* wrapped_view_manager_delegate_; |
170 WindowManagerDelegate* window_manager_delegate_; | 175 WindowManagerDelegate* window_manager_delegate_; |
171 | 176 |
172 scoped_ptr<mojo::ViewManagerClientFactory> view_manager_client_factory_; | 177 scoped_ptr<mojo::ViewManagerClientFactory> view_manager_client_factory_; |
173 mojo::View* root_; | 178 mojo::View* root_; |
174 | 179 |
| 180 ui::GestureProviderImpl gesture_provider_; |
175 scoped_ptr<FocusController> focus_controller_; | 181 scoped_ptr<FocusController> focus_controller_; |
176 scoped_ptr<CaptureController> capture_controller_; | 182 scoped_ptr<CaptureController> capture_controller_; |
177 | 183 |
178 Connections connections_; | 184 Connections connections_; |
179 RegisteredViewIdSet registered_view_id_set_; | 185 RegisteredViewIdSet registered_view_id_set_; |
180 | 186 |
181 mojo::WindowManagerInternalClientPtr window_manager_client_; | 187 mojo::WindowManagerInternalClientPtr window_manager_client_; |
182 | 188 |
183 ScopedVector<PendingEmbed> pending_embeds_; | 189 ScopedVector<PendingEmbed> pending_embeds_; |
184 | 190 |
185 scoped_ptr<mojo::ViewManagerClient> view_manager_client_; | 191 scoped_ptr<mojo::ViewManagerClient> view_manager_client_; |
186 | 192 |
187 scoped_ptr<ViewEventDispatcher> view_event_dispatcher_; | 193 scoped_ptr<ViewEventDispatcher> view_event_dispatcher_; |
188 | 194 |
189 scoped_ptr<mojo::Binding<WindowManagerInternal>> wm_internal_binding_; | 195 scoped_ptr<mojo::Binding<WindowManagerInternal>> wm_internal_binding_; |
190 | 196 |
191 DISALLOW_COPY_AND_ASSIGN(WindowManagerApp); | 197 DISALLOW_COPY_AND_ASSIGN(WindowManagerApp); |
192 }; | 198 }; |
193 | 199 |
194 } // namespace window_manager | 200 } // namespace window_manager |
195 | 201 |
196 #endif // SERVICES_WINDOW_MANAGER_WINDOW_MANAGER_APP_H_ | 202 #endif // SERVICES_WINDOW_MANAGER_WINDOW_MANAGER_APP_H_ |
OLD | NEW |