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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 } | 113 } |
114 InstanceHolder<mojom::PolicyInstance>* policy() { return &policy_; } | 114 InstanceHolder<mojom::PolicyInstance>* policy() { return &policy_; } |
115 InstanceHolder<mojom::PowerInstance>* power() { return &power_; } | 115 InstanceHolder<mojom::PowerInstance>* power() { return &power_; } |
116 InstanceHolder<mojom::PrintInstance>* print() { return &print_; } | 116 InstanceHolder<mojom::PrintInstance>* print() { return &print_; } |
117 InstanceHolder<mojom::ProcessInstance>* process() { return &process_; } | 117 InstanceHolder<mojom::ProcessInstance>* process() { return &process_; } |
118 InstanceHolder<mojom::StorageManagerInstance>* storage_manager() { | 118 InstanceHolder<mojom::StorageManagerInstance>* storage_manager() { |
119 return &storage_manager_; | 119 return &storage_manager_; |
120 } | 120 } |
121 InstanceHolder<mojom::TtsInstance>* tts() { return &tts_; } | 121 InstanceHolder<mojom::TtsInstance>* tts() { return &tts_; } |
122 InstanceHolder<mojom::VideoInstance>* video() { return &video_; } | 122 InstanceHolder<mojom::VideoInstance>* video() { return &video_; } |
| 123 InstanceHolder<mojom::WallpaperInstance>* wallpaper() { return &wallpaper_; } |
123 | 124 |
124 // Gets if ARC is currently running. | 125 // Gets if ARC is currently running. |
125 bool ready() const { return state() == State::READY; } | 126 bool ready() const { return state() == State::READY; } |
126 | 127 |
127 // Gets if ARC is currently stopped. This is not exactly !ready() since there | 128 // Gets if ARC is currently stopped. This is not exactly !ready() since there |
128 // are transient states between ready() and stopped(). | 129 // are transient states between ready() and stopped(). |
129 bool stopped() const { return state() == State::STOPPED; } | 130 bool stopped() const { return state() == State::STOPPED; } |
130 | 131 |
131 protected: | 132 protected: |
132 // The possible states of the bridge. In the normal flow, the state changes | 133 // The possible states of the bridge. In the normal flow, the state changes |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 InstanceHolder<mojom::NetInstance> net_; | 182 InstanceHolder<mojom::NetInstance> net_; |
182 InstanceHolder<mojom::NotificationsInstance> notifications_; | 183 InstanceHolder<mojom::NotificationsInstance> notifications_; |
183 InstanceHolder<mojom::ObbMounterInstance> obb_mounter_; | 184 InstanceHolder<mojom::ObbMounterInstance> obb_mounter_; |
184 InstanceHolder<mojom::PolicyInstance> policy_; | 185 InstanceHolder<mojom::PolicyInstance> policy_; |
185 InstanceHolder<mojom::PowerInstance> power_; | 186 InstanceHolder<mojom::PowerInstance> power_; |
186 InstanceHolder<mojom::PrintInstance> print_; | 187 InstanceHolder<mojom::PrintInstance> print_; |
187 InstanceHolder<mojom::ProcessInstance> process_; | 188 InstanceHolder<mojom::ProcessInstance> process_; |
188 InstanceHolder<mojom::StorageManagerInstance> storage_manager_; | 189 InstanceHolder<mojom::StorageManagerInstance> storage_manager_; |
189 InstanceHolder<mojom::TtsInstance> tts_; | 190 InstanceHolder<mojom::TtsInstance> tts_; |
190 InstanceHolder<mojom::VideoInstance> video_; | 191 InstanceHolder<mojom::VideoInstance> video_; |
| 192 InstanceHolder<mojom::WallpaperInstance> wallpaper_; |
191 | 193 |
192 // Gets the current state of the bridge service. | 194 // Gets the current state of the bridge service. |
193 State state() const { return state_; } | 195 State state() const { return state_; } |
194 | 196 |
195 // Changes the current state and notifies all observers. | 197 // Changes the current state and notifies all observers. |
196 void SetState(State state); | 198 void SetState(State state); |
197 | 199 |
198 // Sets the reason the bridge is stopped. This function must be always called | 200 // Sets the reason the bridge is stopped. This function must be always called |
199 // before SetState(State::STOPPED) to report a correct reason with | 201 // before SetState(State::STOPPED) to report a correct reason with |
200 // Observer::OnBridgeStopped(). | 202 // Observer::OnBridgeStopped(). |
(...skipping 23 matching lines...) Expand all Loading... |
224 | 226 |
225 // WeakPtrFactory to use callbacks. | 227 // WeakPtrFactory to use callbacks. |
226 base::WeakPtrFactory<ArcBridgeService> weak_factory_; | 228 base::WeakPtrFactory<ArcBridgeService> weak_factory_; |
227 | 229 |
228 DISALLOW_COPY_AND_ASSIGN(ArcBridgeService); | 230 DISALLOW_COPY_AND_ASSIGN(ArcBridgeService); |
229 }; | 231 }; |
230 | 232 |
231 } // namespace arc | 233 } // namespace arc |
232 | 234 |
233 #endif // COMPONENTS_ARC_ARC_BRIDGE_SERVICE_H_ | 235 #endif // COMPONENTS_ARC_ARC_BRIDGE_SERVICE_H_ |
OLD | NEW |