| 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_UI_WS_WINDOW_SERVER_H_ | 5 #ifndef SERVICES_UI_WS_WINDOW_SERVER_H_ |
| 6 #define SERVICES_UI_WS_WINDOW_SERVER_H_ | 6 #define SERVICES_UI_WS_WINDOW_SERVER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 WindowManagerWindowTreeFactorySet* window_manager_window_tree_factory_set() { | 136 WindowManagerWindowTreeFactorySet* window_manager_window_tree_factory_set() { |
| 137 return &window_manager_window_tree_factory_set_; | 137 return &window_manager_window_tree_factory_set_; |
| 138 } | 138 } |
| 139 | 139 |
| 140 // Sets focus to |window|. Returns true if |window| already has focus, or | 140 // Sets focus to |window|. Returns true if |window| already has focus, or |
| 141 // focus was successfully changed. Returns |false| if |window| is not a valid | 141 // focus was successfully changed. Returns |false| if |window| is not a valid |
| 142 // window to receive focus. | 142 // window to receive focus. |
| 143 bool SetFocusedWindow(ServerWindow* window); | 143 bool SetFocusedWindow(ServerWindow* window); |
| 144 ServerWindow* GetFocusedWindow(); | 144 ServerWindow* GetFocusedWindow(); |
| 145 | 145 |
| 146 bool IsActiveUserInHighContrastMode() const; |
| 147 void SetHighContrastMode(const UserId& user, bool enabled); |
| 148 |
| 146 // Returns a change id for the window manager that is associated with | 149 // Returns a change id for the window manager that is associated with |
| 147 // |source| and |client_change_id|. When the window manager replies | 150 // |source| and |client_change_id|. When the window manager replies |
| 148 // WindowManagerChangeCompleted() is called to obtain the original source | 151 // WindowManagerChangeCompleted() is called to obtain the original source |
| 149 // and client supplied change_id that initiated the called. | 152 // and client supplied change_id that initiated the called. |
| 150 uint32_t GenerateWindowManagerChangeId(WindowTree* source, | 153 uint32_t GenerateWindowManagerChangeId(WindowTree* source, |
| 151 uint32_t client_change_id); | 154 uint32_t client_change_id); |
| 152 | 155 |
| 153 // Called when a response from the window manager is obtained. Calls to | 156 // Called when a response from the window manager is obtained. Calls to |
| 154 // the client that initiated the change with the change id originally | 157 // the client that initiated the change with the change id originally |
| 155 // supplied by the client. | 158 // supplied by the client. |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 // Updates the native cursor by figuring out what window is under the mouse | 248 // Updates the native cursor by figuring out what window is under the mouse |
| 246 // cursor. This is run in response to events that change the bounds or window | 249 // cursor. This is run in response to events that change the bounds or window |
| 247 // hierarchy. | 250 // hierarchy. |
| 248 void UpdateNativeCursorFromMouseLocation(ServerWindow* window); | 251 void UpdateNativeCursorFromMouseLocation(ServerWindow* window); |
| 249 | 252 |
| 250 // Updates the native cursor if the cursor is currently inside |window|. This | 253 // Updates the native cursor if the cursor is currently inside |window|. This |
| 251 // is run in response to events that change the mouse cursor properties of | 254 // is run in response to events that change the mouse cursor properties of |
| 252 // |window|. | 255 // |window|. |
| 253 void UpdateNativeCursorIfOver(ServerWindow* window); | 256 void UpdateNativeCursorIfOver(ServerWindow* window); |
| 254 | 257 |
| 258 bool IsUserInHighContrastMode(const UserId& user) const; |
| 259 |
| 255 // Overridden from ServerWindowDelegate: | 260 // Overridden from ServerWindowDelegate: |
| 256 ui::SurfacesState* GetSurfacesState() override; | 261 ui::SurfacesState* GetSurfacesState() override; |
| 257 void OnScheduleWindowPaint(ServerWindow* window) override; | 262 void OnScheduleWindowPaint(ServerWindow* window) override; |
| 258 const ServerWindow* GetRootWindow(const ServerWindow* window) const override; | 263 const ServerWindow* GetRootWindow(const ServerWindow* window) const override; |
| 259 void ScheduleSurfaceDestruction(ServerWindow* window) override; | 264 void ScheduleSurfaceDestruction(ServerWindow* window) override; |
| 260 | 265 |
| 261 // Overridden from ServerWindowObserver: | 266 // Overridden from ServerWindowObserver: |
| 262 void OnWindowDestroyed(ServerWindow* window) override; | 267 void OnWindowDestroyed(ServerWindow* window) override; |
| 263 void OnWillChangeWindowHierarchy(ServerWindow* window, | 268 void OnWillChangeWindowHierarchy(ServerWindow* window, |
| 264 ServerWindow* new_parent, | 269 ServerWindow* new_parent, |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 std::unique_ptr<CurrentMoveLoopState> current_move_loop_; | 331 std::unique_ptr<CurrentMoveLoopState> current_move_loop_; |
| 327 | 332 |
| 328 // Set of WindowTrees. | 333 // Set of WindowTrees. |
| 329 WindowTreeMap tree_map_; | 334 WindowTreeMap tree_map_; |
| 330 | 335 |
| 331 // If non-null then we're processing a client operation. The Operation is | 336 // If non-null then we're processing a client operation. The Operation is |
| 332 // not owned by us (it's created on the stack by WindowTree). | 337 // not owned by us (it's created on the stack by WindowTree). |
| 333 Operation* current_operation_; | 338 Operation* current_operation_; |
| 334 | 339 |
| 335 bool in_destructor_; | 340 bool in_destructor_; |
| 341 std::map<UserId, bool> high_contrast_mode_; |
| 336 | 342 |
| 337 // Maps from window manager change id to the client that initiated the | 343 // Maps from window manager change id to the client that initiated the |
| 338 // request. | 344 // request. |
| 339 InFlightWindowManagerChangeMap in_flight_wm_change_map_; | 345 InFlightWindowManagerChangeMap in_flight_wm_change_map_; |
| 340 | 346 |
| 341 // Next id supplied to the window manager. | 347 // Next id supplied to the window manager. |
| 342 uint32_t next_wm_change_id_; | 348 uint32_t next_wm_change_id_; |
| 343 | 349 |
| 344 base::Callback<void(ServerWindow*)> window_paint_callback_; | 350 base::Callback<void(ServerWindow*)> window_paint_callback_; |
| 345 | 351 |
| 346 UserActivityMonitorMap activity_monitor_map_; | 352 UserActivityMonitorMap activity_monitor_map_; |
| 347 | 353 |
| 348 WindowManagerWindowTreeFactorySet window_manager_window_tree_factory_set_; | 354 WindowManagerWindowTreeFactorySet window_manager_window_tree_factory_set_; |
| 349 | 355 |
| 350 DISALLOW_COPY_AND_ASSIGN(WindowServer); | 356 DISALLOW_COPY_AND_ASSIGN(WindowServer); |
| 351 }; | 357 }; |
| 352 | 358 |
| 353 } // namespace ws | 359 } // namespace ws |
| 354 } // namespace ui | 360 } // namespace ui |
| 355 | 361 |
| 356 #endif // SERVICES_UI_WS_WINDOW_SERVER_H_ | 362 #endif // SERVICES_UI_WS_WINDOW_SERVER_H_ |
| OLD | NEW |