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_SERVICE_H_ | 5 #ifndef SERVICES_UI_SERVICE_H_ |
6 #define SERVICES_UI_SERVICE_H_ | 6 #define SERVICES_UI_SERVICE_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 private: | 83 private: |
84 // Holds InterfaceRequests received before the first WindowTreeHost Display | 84 // Holds InterfaceRequests received before the first WindowTreeHost Display |
85 // has been established. | 85 // has been established. |
86 struct PendingRequest; | 86 struct PendingRequest; |
87 struct UserState; | 87 struct UserState; |
88 | 88 |
89 using UserIdToUserState = std::map<ws::UserId, std::unique_ptr<UserState>>; | 89 using UserIdToUserState = std::map<ws::UserId, std::unique_ptr<UserState>>; |
90 | 90 |
91 void InitializeResources(shell::Connector* connector); | 91 void InitializeResources(shell::Connector* connector); |
92 | 92 |
93 // Returns the user specific state for the user id of |connection|. Service | 93 // Returns the user specific state for the user id of |remote_identity|. |
94 // owns the return value. | 94 // Service owns the return value. |
95 // TODO(sky): if we allow removal of user ids then we need to close anything | 95 // TODO(sky): if we allow removal of user ids then we need to close anything |
96 // associated with the user (all incoming pipes...) on removal. | 96 // associated with the user (all incoming pipes...) on removal. |
97 UserState* GetUserState(shell::Connection* connection); | 97 UserState* GetUserState(const shell::Identity& remote_identity); |
98 | 98 |
99 void AddUserIfNecessary(shell::Connection* connection); | 99 void AddUserIfNecessary(const shell::Identity& remote_identity); |
100 | 100 |
101 // shell::Service: | 101 // shell::Service: |
102 void OnStart(shell::Connector* connector, | 102 void OnStart(shell::Connector* connector, |
103 const shell::Identity& identity, | 103 const shell::Identity& identity, |
104 uint32_t id) override; | 104 uint32_t id) override; |
105 bool OnConnect(shell::Connection* connection) override; | 105 bool OnConnect(shell::Connection* connection) override; |
106 | 106 |
107 // WindowServerDelegate: | 107 // WindowServerDelegate: |
108 void OnFirstDisplayReady() override; | 108 void OnFirstDisplayReady() override; |
109 void OnNoMoreDisplays() override; | 109 void OnNoMoreDisplays() override; |
110 bool IsTestConfig() const override; | 110 bool IsTestConfig() const override; |
111 void CreateDefaultDisplays() override; | 111 void CreateDefaultDisplays() override; |
112 | 112 |
113 // shell::InterfaceFactory<mojom::AccessibilityManager> implementation. | 113 // shell::InterfaceFactory<mojom::AccessibilityManager> implementation. |
114 void Create(shell::Connection* connection, | 114 void Create(const shell::Identity& remote_identity, |
115 mojom::AccessibilityManagerRequest request) override; | 115 mojom::AccessibilityManagerRequest request) override; |
116 | 116 |
117 // shell::InterfaceFactory<mojom::Clipboard> implementation. | 117 // shell::InterfaceFactory<mojom::Clipboard> implementation. |
118 void Create(shell::Connection* connection, | 118 void Create(const shell::Identity& remote_identity, |
119 mojom::ClipboardRequest request) override; | 119 mojom::ClipboardRequest request) override; |
120 | 120 |
121 // shell::InterfaceFactory<mojom::DisplayManager> implementation. | 121 // shell::InterfaceFactory<mojom::DisplayManager> implementation. |
122 void Create(shell::Connection* connection, | 122 void Create(const shell::Identity& remote_identity, |
123 mojom::DisplayManagerRequest request) override; | 123 mojom::DisplayManagerRequest request) override; |
124 | 124 |
125 // shell::InterfaceFactory<mojom::Gpu> implementation. | 125 // shell::InterfaceFactory<mojom::Gpu> implementation. |
126 void Create(shell::Connection* connection, | 126 void Create(const shell::Identity& remote_identity, |
127 mojom::GpuRequest request) override; | 127 mojom::GpuRequest request) override; |
128 | 128 |
129 // shell::InterfaceFactory<mojom::GpuService> implementation. | 129 // shell::InterfaceFactory<mojom::GpuService> implementation. |
130 void Create(shell::Connection* connection, | 130 void Create(const shell::Identity& remote_identity, |
131 mojom::GpuServiceRequest request) override; | 131 mojom::GpuServiceRequest request) override; |
132 | 132 |
133 // shell::InterfaceFactory<mojom::UserAccessManager> implementation. | 133 // shell::InterfaceFactory<mojom::UserAccessManager> implementation. |
134 void Create(shell::Connection* connection, | 134 void Create(const shell::Identity& remote_identity, |
135 mojom::UserAccessManagerRequest request) override; | 135 mojom::UserAccessManagerRequest request) override; |
136 | 136 |
137 // shell::InterfaceFactory<mojom::UserActivityMonitor> implementation. | 137 // shell::InterfaceFactory<mojom::UserActivityMonitor> implementation. |
138 void Create(shell::Connection* connection, | 138 void Create(const shell::Identity& remote_identity, |
139 mojom::UserActivityMonitorRequest request) override; | 139 mojom::UserActivityMonitorRequest request) override; |
140 | 140 |
141 // shell::InterfaceFactory<mojom::WindowManagerWindowTreeFactory> | 141 // shell::InterfaceFactory<mojom::WindowManagerWindowTreeFactory> |
142 // implementation. | 142 // implementation. |
143 void Create(shell::Connection* connection, | 143 void Create(const shell::Identity& remote_identity, |
144 mojom::WindowManagerWindowTreeFactoryRequest request) override; | 144 mojom::WindowManagerWindowTreeFactoryRequest request) override; |
145 | 145 |
146 // shell::InterfaceFactory<mojom::WindowTreeFactory>: | 146 // shell::InterfaceFactory<mojom::WindowTreeFactory>: |
147 void Create(shell::Connection* connection, | 147 void Create(const shell::Identity& remote_identity, |
148 mojom::WindowTreeFactoryRequest request) override; | 148 mojom::WindowTreeFactoryRequest request) override; |
149 | 149 |
150 // shell::InterfaceFactory<mojom::WindowTreeHostFactory>: | 150 // shell::InterfaceFactory<mojom::WindowTreeHostFactory>: |
151 void Create(shell::Connection* connection, | 151 void Create(const shell::Identity& remote_identity, |
152 mojom::WindowTreeHostFactoryRequest request) override; | 152 mojom::WindowTreeHostFactoryRequest request) override; |
153 | 153 |
154 // shell::InterfaceFactory<mojom::WindowServerTest> implementation. | 154 // shell::InterfaceFactory<mojom::WindowServerTest> implementation. |
155 void Create(shell::Connection* connection, | 155 void Create(const shell::Identity& remote_identity, |
156 mojom::WindowServerTestRequest request) override; | 156 mojom::WindowServerTestRequest request) override; |
157 | 157 |
158 // Callback for display configuration. |id| is the identifying token for the | 158 // Callback for display configuration. |id| is the identifying token for the |
159 // configured display that will identify a specific physical display across | 159 // configured display that will identify a specific physical display across |
160 // configuration changes. |bounds| is the bounds of the display in screen | 160 // configuration changes. |bounds| is the bounds of the display in screen |
161 // coordinates. | 161 // coordinates. |
162 void OnCreatedPhysicalDisplay(int64_t id, const gfx::Rect& bounds); | 162 void OnCreatedPhysicalDisplay(int64_t id, const gfx::Rect& bounds); |
163 | 163 |
164 ws::PlatformDisplayInitParams platform_display_init_params_; | 164 ws::PlatformDisplayInitParams platform_display_init_params_; |
165 std::unique_ptr<ws::WindowServer> window_server_; | 165 std::unique_ptr<ws::WindowServer> window_server_; |
(...skipping 17 matching lines...) Expand all Loading... |
183 std::unique_ptr<ws::TouchController> touch_controller_; | 183 std::unique_ptr<ws::TouchController> touch_controller_; |
184 | 184 |
185 base::WeakPtrFactory<Service> weak_ptr_factory_; | 185 base::WeakPtrFactory<Service> weak_ptr_factory_; |
186 | 186 |
187 DISALLOW_COPY_AND_ASSIGN(Service); | 187 DISALLOW_COPY_AND_ASSIGN(Service); |
188 }; | 188 }; |
189 | 189 |
190 } // namespace ui | 190 } // namespace ui |
191 | 191 |
192 #endif // SERVICES_UI_SERVICE_H_ | 192 #endif // SERVICES_UI_SERVICE_H_ |
OLD | NEW |