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 InstanceHolder<mojom::ObbMounterInstance>* obb_mounter() { | 113 InstanceHolder<mojom::ObbMounterInstance>* obb_mounter() { |
114 return &obb_mounter_; | 114 return &obb_mounter_; |
115 } | 115 } |
116 InstanceHolder<mojom::PolicyInstance>* policy() { return &policy_; } | 116 InstanceHolder<mojom::PolicyInstance>* policy() { return &policy_; } |
117 InstanceHolder<mojom::PowerInstance>* power() { return &power_; } | 117 InstanceHolder<mojom::PowerInstance>* power() { return &power_; } |
118 InstanceHolder<mojom::ProcessInstance>* process() { return &process_; } | 118 InstanceHolder<mojom::ProcessInstance>* process() { return &process_; } |
119 InstanceHolder<mojom::StorageManagerInstance>* storage_manager() { | 119 InstanceHolder<mojom::StorageManagerInstance>* storage_manager() { |
120 return &storage_manager_; | 120 return &storage_manager_; |
121 } | 121 } |
122 InstanceHolder<mojom::VideoInstance>* video() { return &video_; } | 122 InstanceHolder<mojom::VideoInstance>* video() { return &video_; } |
123 InstanceHolder<mojom::WindowManagerInstance>* window_manager() { | |
124 return &window_manager_; | |
125 } | |
126 | 123 |
127 // Gets if ARC is available in this system. | 124 // Gets if ARC is available in this system. |
128 bool available() const { return available_; } | 125 bool available() const { return available_; } |
129 | 126 |
130 // Gets if ARC is currently running. | 127 // Gets if ARC is currently running. |
131 bool ready() const { return state() == State::READY; } | 128 bool ready() const { return state() == State::READY; } |
132 | 129 |
133 // Gets if ARC is currently stopped. This is not exactly !ready() since there | 130 // Gets if ARC is currently stopped. This is not exactly !ready() since there |
134 // are transient states between ready() and stopped(). | 131 // are transient states between ready() and stopped(). |
135 bool stopped() const { return state() == State::STOPPED; } | 132 bool stopped() const { return state() == State::STOPPED; } |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 InstanceHolder<mojom::IntentHelperInstance> intent_helper_; | 181 InstanceHolder<mojom::IntentHelperInstance> intent_helper_; |
185 InstanceHolder<mojom::MetricsInstance> metrics_; | 182 InstanceHolder<mojom::MetricsInstance> metrics_; |
186 InstanceHolder<mojom::NetInstance> net_; | 183 InstanceHolder<mojom::NetInstance> net_; |
187 InstanceHolder<mojom::NotificationsInstance> notifications_; | 184 InstanceHolder<mojom::NotificationsInstance> notifications_; |
188 InstanceHolder<mojom::ObbMounterInstance> obb_mounter_; | 185 InstanceHolder<mojom::ObbMounterInstance> obb_mounter_; |
189 InstanceHolder<mojom::PolicyInstance> policy_; | 186 InstanceHolder<mojom::PolicyInstance> policy_; |
190 InstanceHolder<mojom::PowerInstance> power_; | 187 InstanceHolder<mojom::PowerInstance> power_; |
191 InstanceHolder<mojom::ProcessInstance> process_; | 188 InstanceHolder<mojom::ProcessInstance> process_; |
192 InstanceHolder<mojom::StorageManagerInstance> storage_manager_; | 189 InstanceHolder<mojom::StorageManagerInstance> storage_manager_; |
193 InstanceHolder<mojom::VideoInstance> video_; | 190 InstanceHolder<mojom::VideoInstance> video_; |
194 InstanceHolder<mojom::WindowManagerInstance> window_manager_; | |
195 | 191 |
196 // Gets the current state of the bridge service. | 192 // Gets the current state of the bridge service. |
197 State state() const { return state_; } | 193 State state() const { return state_; } |
198 | 194 |
199 // Changes the current state and notifies all observers. | 195 // Changes the current state and notifies all observers. |
200 void SetState(State state); | 196 void SetState(State state); |
201 | 197 |
202 // Changes the current availability and notifies all observers. | 198 // Changes the current availability and notifies all observers. |
203 void SetAvailable(bool availability); | 199 void SetAvailable(bool availability); |
204 | 200 |
(...skipping 29 matching lines...) Expand all Loading... |
234 | 230 |
235 // WeakPtrFactory to use callbacks. | 231 // WeakPtrFactory to use callbacks. |
236 base::WeakPtrFactory<ArcBridgeService> weak_factory_; | 232 base::WeakPtrFactory<ArcBridgeService> weak_factory_; |
237 | 233 |
238 DISALLOW_COPY_AND_ASSIGN(ArcBridgeService); | 234 DISALLOW_COPY_AND_ASSIGN(ArcBridgeService); |
239 }; | 235 }; |
240 | 236 |
241 } // namespace arc | 237 } // namespace arc |
242 | 238 |
243 #endif // COMPONENTS_ARC_ARC_BRIDGE_SERVICE_H_ | 239 #endif // COMPONENTS_ARC_ARC_BRIDGE_SERVICE_H_ |
OLD | NEW |