| 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 COMPONENTS_MUS_WS_CONNECTION_MANAGER_H_ | 5 #ifndef COMPONENTS_MUS_WS_CONNECTION_MANAGER_H_ |
| 6 #define COMPONENTS_MUS_WS_CONNECTION_MANAGER_H_ | 6 #define COMPONENTS_MUS_WS_CONNECTION_MANAGER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 | 33 |
| 34 class ConnectionManagerDelegate; | 34 class ConnectionManagerDelegate; |
| 35 class DisplayManager; | 35 class DisplayManager; |
| 36 class ServerWindow; | 36 class ServerWindow; |
| 37 class WindowManagerState; | 37 class WindowManagerState; |
| 38 class WindowTree; | 38 class WindowTree; |
| 39 class WindowTreeBinding; | 39 class WindowTreeBinding; |
| 40 | 40 |
| 41 // ConnectionManager manages the set of connections to the window server (all | 41 // ConnectionManager manages the set of connections to the window server (all |
| 42 // the WindowTrees) as well as providing the root of the hierarchy. | 42 // the WindowTrees) as well as providing the root of the hierarchy. |
| 43 // | |
| 44 // TODO(sky): this class is doing too much. Refactor to make responsibilities | |
| 45 // clearer. | |
| 46 class ConnectionManager : public ServerWindowDelegate, | 43 class ConnectionManager : public ServerWindowDelegate, |
| 47 public ServerWindowObserver, | 44 public ServerWindowObserver, |
| 48 public DisplayManagerDelegate { | 45 public DisplayManagerDelegate { |
| 49 public: | 46 public: |
| 50 ConnectionManager(ConnectionManagerDelegate* delegate, | 47 ConnectionManager(ConnectionManagerDelegate* delegate, |
| 51 const scoped_refptr<mus::SurfacesState>& surfaces_state); | 48 const scoped_refptr<mus::SurfacesState>& surfaces_state); |
| 52 ~ConnectionManager() override; | 49 ~ConnectionManager() override; |
| 53 | 50 |
| 54 ConnectionManagerDelegate* delegate() { return delegate_; } | 51 ConnectionManagerDelegate* delegate() { return delegate_; } |
| 55 | 52 |
| 56 UserIdTracker* user_id_tracker() { return &user_id_tracker_; } | 53 UserIdTracker* user_id_tracker() { return &user_id_tracker_; } |
| 54 const UserIdTracker* user_id_tracker() const { return &user_id_tracker_; } |
| 57 | 55 |
| 58 DisplayManager* display_manager() { return display_manager_.get(); } | 56 DisplayManager* display_manager() { return display_manager_.get(); } |
| 59 const DisplayManager* display_manager() const { | 57 const DisplayManager* display_manager() const { |
| 60 return display_manager_.get(); | 58 return display_manager_.get(); |
| 61 } | 59 } |
| 62 | 60 |
| 63 // Creates a new ServerWindow. The return value is owned by the caller, but | 61 // Creates a new ServerWindow. The return value is owned by the caller, but |
| 64 // must be destroyed before ConnectionManager. | 62 // must be destroyed before ConnectionManager. |
| 65 ServerWindow* CreateServerWindow( | 63 ServerWindow* CreateServerWindow( |
| 66 const WindowId& id, | 64 const WindowId& id, |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 void OnWindowPredefinedCursorChanged(ServerWindow* window, | 247 void OnWindowPredefinedCursorChanged(ServerWindow* window, |
| 250 int32_t cursor_id) override; | 248 int32_t cursor_id) override; |
| 251 void OnWindowTextInputStateChanged(ServerWindow* window, | 249 void OnWindowTextInputStateChanged(ServerWindow* window, |
| 252 const ui::TextInputState& state) override; | 250 const ui::TextInputState& state) override; |
| 253 void OnTransientWindowAdded(ServerWindow* window, | 251 void OnTransientWindowAdded(ServerWindow* window, |
| 254 ServerWindow* transient_child) override; | 252 ServerWindow* transient_child) override; |
| 255 void OnTransientWindowRemoved(ServerWindow* window, | 253 void OnTransientWindowRemoved(ServerWindow* window, |
| 256 ServerWindow* transient_child) override; | 254 ServerWindow* transient_child) override; |
| 257 | 255 |
| 258 // DisplayManagerDelegate: | 256 // DisplayManagerDelegate: |
| 259 void OnWillDestroyDisplay(Display* display) override; | |
| 260 void OnFirstDisplayReady() override; | 257 void OnFirstDisplayReady() override; |
| 261 void OnNoMoreDisplays() override; | 258 void OnNoMoreDisplays() override; |
| 262 | 259 |
| 263 UserIdTracker user_id_tracker_; | 260 UserIdTracker user_id_tracker_; |
| 264 | 261 |
| 265 ConnectionManagerDelegate* delegate_; | 262 ConnectionManagerDelegate* delegate_; |
| 266 | 263 |
| 267 // State for rendering into a Surface. | 264 // State for rendering into a Surface. |
| 268 scoped_refptr<mus::SurfacesState> surfaces_state_; | 265 scoped_refptr<mus::SurfacesState> surfaces_state_; |
| 269 | 266 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 290 | 287 |
| 291 WindowManagerFactoryRegistry window_manager_factory_registry_; | 288 WindowManagerFactoryRegistry window_manager_factory_registry_; |
| 292 | 289 |
| 293 DISALLOW_COPY_AND_ASSIGN(ConnectionManager); | 290 DISALLOW_COPY_AND_ASSIGN(ConnectionManager); |
| 294 }; | 291 }; |
| 295 | 292 |
| 296 } // namespace ws | 293 } // namespace ws |
| 297 } // namespace mus | 294 } // namespace mus |
| 298 | 295 |
| 299 #endif // COMPONENTS_MUS_WS_CONNECTION_MANAGER_H_ | 296 #endif // COMPONENTS_MUS_WS_CONNECTION_MANAGER_H_ |
| OLD | NEW |