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 "services/ui/ws/window_server.h" | 5 #include "services/ui/ws/window_server.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 namespace ui { | 31 namespace ui { |
32 namespace ws { | 32 namespace ws { |
33 | 33 |
34 struct WindowServer::CurrentMoveLoopState { | 34 struct WindowServer::CurrentMoveLoopState { |
35 uint32_t change_id; | 35 uint32_t change_id; |
36 ServerWindow* window; | 36 ServerWindow* window; |
37 WindowTree* initiator; | 37 WindowTree* initiator; |
38 gfx::Rect revert_bounds; | 38 gfx::Rect revert_bounds; |
39 }; | 39 }; |
40 | 40 |
41 WindowServer::WindowServer(WindowServerDelegate* delegate) | 41 WindowServer::WindowServer(WindowServerDelegate* delegate, |
| 42 shell::Connector* connector) |
42 : delegate_(delegate), | 43 : delegate_(delegate), |
43 surfaces_state_(new SurfacesState()), | 44 surfaces_state_(new SurfacesState()), |
44 next_client_id_(1), | 45 next_client_id_(1), |
45 display_manager_(new DisplayManager(this, &user_id_tracker_)), | 46 display_manager_(new DisplayManager(this, &user_id_tracker_)), |
46 current_operation_(nullptr), | 47 current_operation_(nullptr), |
47 in_destructor_(false), | 48 in_destructor_(false), |
48 next_wm_change_id_(0), | 49 next_wm_change_id_(0), |
49 gpu_proxy_(new GpuServiceProxy(this)), | 50 gpu_proxy_(new GpuServiceProxy(this, connector)), |
50 window_manager_window_tree_factory_set_(this, &user_id_tracker_) { | 51 window_manager_window_tree_factory_set_(this, &user_id_tracker_) { |
51 user_id_tracker_.AddObserver(this); | 52 user_id_tracker_.AddObserver(this); |
52 OnUserIdAdded(user_id_tracker_.active_id()); | 53 OnUserIdAdded(user_id_tracker_.active_id()); |
53 } | 54 } |
54 | 55 |
55 WindowServer::~WindowServer() { | 56 WindowServer::~WindowServer() { |
56 in_destructor_ = true; | 57 in_destructor_ = true; |
57 | 58 |
58 // Destroys the window trees results in querying for the display. Tear down | 59 // Destroys the window trees results in querying for the display. Tear down |
59 // the displays first so that the trees are notified of the display going | 60 // the displays first so that the trees are notified of the display going |
(...skipping 733 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
793 clipboard_map_[id] = base::MakeUnique<clipboard::ClipboardImpl>(); | 794 clipboard_map_[id] = base::MakeUnique<clipboard::ClipboardImpl>(); |
794 } | 795 } |
795 | 796 |
796 void WindowServer::OnUserIdRemoved(const UserId& id) { | 797 void WindowServer::OnUserIdRemoved(const UserId& id) { |
797 activity_monitor_map_.erase(id); | 798 activity_monitor_map_.erase(id); |
798 clipboard_map_.erase(id); | 799 clipboard_map_.erase(id); |
799 } | 800 } |
800 | 801 |
801 } // namespace ws | 802 } // namespace ws |
802 } // namespace ui | 803 } // namespace ui |
OLD | NEW |