OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_ARC_ARC_BRIDGE_SERVICE_H_ | 5 #ifndef COMPONENTS_ARC_ARC_BRIDGE_SERVICE_H_ |
6 #define COMPONENTS_ARC_ARC_BRIDGE_SERVICE_H_ | 6 #define COMPONENTS_ARC_ARC_BRIDGE_SERVICE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
86 virtual void OnClipboardInstanceClosed() {} | 86 virtual void OnClipboardInstanceClosed() {} |
87 | 87 |
88 // Called whenever the ARC input interface state changes. | 88 // Called whenever the ARC input interface state changes. |
89 virtual void OnInputInstanceReady() {} | 89 virtual void OnInputInstanceReady() {} |
90 virtual void OnInputInstanceClosed() {} | 90 virtual void OnInputInstanceClosed() {} |
91 | 91 |
92 // Called whenever the ARC notification interface state changes. | 92 // Called whenever the ARC notification interface state changes. |
93 virtual void OnNotificationsInstanceReady() {} | 93 virtual void OnNotificationsInstanceReady() {} |
94 virtual void OnNotificationsInstanceClosed() {} | 94 virtual void OnNotificationsInstanceClosed() {} |
95 | 95 |
96 // Called whenever the ARC net interface state changes. | |
97 virtual void OnNetInstanceReady() {} | |
hidehiko
2016/01/13 05:58:56
Please follow the current code around here for thi
cernekee
2016/01/14 03:08:58
Could you please clarify what you mean by that?
hidehiko
2016/01/14 04:06:32
You need to support
- "close"ing functions and the
cernekee
2016/01/14 21:22:23
Done.
| |
98 | |
96 // Called whenever the ARC power interface state changes. | 99 // Called whenever the ARC power interface state changes. |
97 virtual void OnPowerInstanceReady() {} | 100 virtual void OnPowerInstanceReady() {} |
98 virtual void OnPowerInstanceClosed() {} | 101 virtual void OnPowerInstanceClosed() {} |
99 | 102 |
100 // Called whenever the ARC process interface state changes. | 103 // Called whenever the ARC process interface state changes. |
101 virtual void OnProcessInstanceReady() {} | 104 virtual void OnProcessInstanceReady() {} |
102 virtual void OnProcessInstanceClosed() {} | 105 virtual void OnProcessInstanceClosed() {} |
103 | 106 |
104 // Called whenever the ARC settings interface state changes. | 107 // Called whenever the ARC settings interface state changes. |
105 virtual void OnSettingsInstanceReady() {} | 108 virtual void OnSettingsInstanceReady() {} |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
139 void RemoveObserver(Observer* observer); | 142 void RemoveObserver(Observer* observer); |
140 | 143 |
141 // Gets the Mojo interface for all the instance services. This will return | 144 // Gets the Mojo interface for all the instance services. This will return |
142 // nullptr if that particular service is not ready yet. Use an Observer if | 145 // nullptr if that particular service is not ready yet. Use an Observer if |
143 // you want to be notified when this is ready. This can only be called on the | 146 // you want to be notified when this is ready. This can only be called on the |
144 // thread that this class was created on. | 147 // thread that this class was created on. |
145 AppInstance* app_instance() { return app_ptr_.get(); } | 148 AppInstance* app_instance() { return app_ptr_.get(); } |
146 AuthInstance* auth_instance() { return auth_ptr_.get(); } | 149 AuthInstance* auth_instance() { return auth_ptr_.get(); } |
147 ClipboardInstance* clipboard_instance() { return clipboard_ptr_.get(); } | 150 ClipboardInstance* clipboard_instance() { return clipboard_ptr_.get(); } |
148 InputInstance* input_instance() { return input_ptr_.get(); } | 151 InputInstance* input_instance() { return input_ptr_.get(); } |
152 NetInstance* net_instance() { return net_ptr_.get(); } | |
149 NotificationsInstance* notifications_instance() { | 153 NotificationsInstance* notifications_instance() { |
150 return notifications_ptr_.get(); | 154 return notifications_ptr_.get(); |
151 } | 155 } |
152 PowerInstance* power_instance() { return power_ptr_.get(); } | 156 PowerInstance* power_instance() { return power_ptr_.get(); } |
153 ProcessInstance* process_instance() { return process_ptr_.get(); } | 157 ProcessInstance* process_instance() { return process_ptr_.get(); } |
154 SettingsInstance* settings_instance() { return settings_ptr_.get(); } | 158 SettingsInstance* settings_instance() { return settings_ptr_.get(); } |
155 | 159 |
156 int32_t app_version() const { return app_ptr_.version(); } | 160 int32_t app_version() const { return app_ptr_.version(); } |
157 int32_t auth_version() const { return auth_ptr_.version(); } | 161 int32_t auth_version() const { return auth_ptr_.version(); } |
158 int32_t clipboard_version() const { return clipboard_ptr_.version(); } | 162 int32_t clipboard_version() const { return clipboard_ptr_.version(); } |
159 int32_t input_version() const { return input_ptr_.version(); } | 163 int32_t input_version() const { return input_ptr_.version(); } |
160 int32_t notifications_version() const { return notifications_ptr_.version(); } | 164 int32_t notifications_version() const { return notifications_ptr_.version(); } |
161 int32_t power_version() const { return power_ptr_.version(); } | 165 int32_t power_version() const { return power_ptr_.version(); } |
162 int32_t process_version() const { return process_ptr_.version(); } | 166 int32_t process_version() const { return process_ptr_.version(); } |
163 int32_t settings_version() const { return settings_ptr_.version(); } | 167 int32_t settings_version() const { return settings_ptr_.version(); } |
164 | 168 |
165 // ArcHost: | 169 // ArcHost: |
166 void OnAppInstanceReady(AppInstancePtr app_ptr) override; | 170 void OnAppInstanceReady(AppInstancePtr app_ptr) override; |
167 void OnAuthInstanceReady(AuthInstancePtr auth_ptr) override; | 171 void OnAuthInstanceReady(AuthInstancePtr auth_ptr) override; |
168 void OnClipboardInstanceReady(ClipboardInstancePtr clipboard_ptr) override; | 172 void OnClipboardInstanceReady(ClipboardInstancePtr clipboard_ptr) override; |
169 void OnInputInstanceReady(InputInstancePtr input_ptr) override; | 173 void OnInputInstanceReady(InputInstancePtr input_ptr) override; |
174 void OnNetInstanceReady(NetInstancePtr net_ptr) override; | |
170 void OnNotificationsInstanceReady( | 175 void OnNotificationsInstanceReady( |
171 NotificationsInstancePtr notifications_ptr) override; | 176 NotificationsInstancePtr notifications_ptr) override; |
172 void OnPowerInstanceReady(PowerInstancePtr power_ptr) override; | 177 void OnPowerInstanceReady(PowerInstancePtr power_ptr) override; |
173 void OnProcessInstanceReady(ProcessInstancePtr process_ptr) override; | 178 void OnProcessInstanceReady(ProcessInstancePtr process_ptr) override; |
174 void OnSettingsInstanceReady(SettingsInstancePtr process_ptr) override; | 179 void OnSettingsInstanceReady(SettingsInstancePtr process_ptr) override; |
175 | 180 |
176 // Gets the current state of the bridge service. | 181 // Gets the current state of the bridge service. |
177 State state() const { return state_; } | 182 State state() const { return state_; } |
178 | 183 |
179 // Gets if ARC is available in this system. | 184 // Gets if ARC is available in this system. |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
220 void OnNotificationsVersionReady(int32_t version); | 225 void OnNotificationsVersionReady(int32_t version); |
221 void OnPowerVersionReady(int32_t version); | 226 void OnPowerVersionReady(int32_t version); |
222 void OnProcessVersionReady(int32_t version); | 227 void OnProcessVersionReady(int32_t version); |
223 void OnSettingsVersionReady(int32_t version); | 228 void OnSettingsVersionReady(int32_t version); |
224 | 229 |
225 // Mojo interfaces. | 230 // Mojo interfaces. |
226 AppInstancePtr app_ptr_; | 231 AppInstancePtr app_ptr_; |
227 AuthInstancePtr auth_ptr_; | 232 AuthInstancePtr auth_ptr_; |
228 ClipboardInstancePtr clipboard_ptr_; | 233 ClipboardInstancePtr clipboard_ptr_; |
229 InputInstancePtr input_ptr_; | 234 InputInstancePtr input_ptr_; |
235 NetInstancePtr net_ptr_; | |
230 NotificationsInstancePtr notifications_ptr_; | 236 NotificationsInstancePtr notifications_ptr_; |
231 PowerInstancePtr power_ptr_; | 237 PowerInstancePtr power_ptr_; |
232 ProcessInstancePtr process_ptr_; | 238 ProcessInstancePtr process_ptr_; |
233 SettingsInstancePtr settings_ptr_; | 239 SettingsInstancePtr settings_ptr_; |
234 | 240 |
235 // Temporary Mojo interfaces. After a Mojo interface pointer has been | 241 // Temporary Mojo interfaces. After a Mojo interface pointer has been |
236 // received from the other endpoint, we still need to asynchronously query | 242 // received from the other endpoint, we still need to asynchronously query |
237 // its version. While that is going on, we should still return nullptr on | 243 // its version. While that is going on, we should still return nullptr on |
238 // the xxx_instance() functions. | 244 // the xxx_instance() functions. |
239 // To keep the xxx_instance() functions being trivial, store the instance | 245 // To keep the xxx_instance() functions being trivial, store the instance |
(...skipping 19 matching lines...) Expand all Loading... | |
259 | 265 |
260 // WeakPtrFactory to use callbacks. | 266 // WeakPtrFactory to use callbacks. |
261 base::WeakPtrFactory<ArcBridgeService> weak_factory_; | 267 base::WeakPtrFactory<ArcBridgeService> weak_factory_; |
262 | 268 |
263 DISALLOW_COPY_AND_ASSIGN(ArcBridgeService); | 269 DISALLOW_COPY_AND_ASSIGN(ArcBridgeService); |
264 }; | 270 }; |
265 | 271 |
266 } // namespace arc | 272 } // namespace arc |
267 | 273 |
268 #endif // COMPONENTS_ARC_ARC_BRIDGE_SERVICE_H_ | 274 #endif // COMPONENTS_ARC_ARC_BRIDGE_SERVICE_H_ |
OLD | NEW |