| 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 <iosfwd> | 8 #include <iosfwd> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 class KioskInstance; | 43 class KioskInstance; |
| 44 class MetricsInstance; | 44 class MetricsInstance; |
| 45 class NetInstance; | 45 class NetInstance; |
| 46 class NotificationsInstance; | 46 class NotificationsInstance; |
| 47 class ObbMounterInstance; | 47 class ObbMounterInstance; |
| 48 class PolicyInstance; | 48 class PolicyInstance; |
| 49 class PowerInstance; | 49 class PowerInstance; |
| 50 class PrintInstance; | 50 class PrintInstance; |
| 51 class ProcessInstance; | 51 class ProcessInstance; |
| 52 class StorageManagerInstance; | 52 class StorageManagerInstance; |
| 53 class TraceInstance; |
| 53 class TtsInstance; | 54 class TtsInstance; |
| 54 class VideoInstance; | 55 class VideoInstance; |
| 55 class WallpaperInstance; | 56 class WallpaperInstance; |
| 56 | 57 |
| 57 } // namespace mojom | 58 } // namespace mojom |
| 58 | 59 |
| 59 // The Chrome-side service that handles ARC instances and ARC bridge creation. | 60 // The Chrome-side service that handles ARC instances and ARC bridge creation. |
| 60 // This service handles the lifetime of ARC instances and sets up the | 61 // This service handles the lifetime of ARC instances and sets up the |
| 61 // communication channel (the ARC bridge) used to send and receive messages. | 62 // communication channel (the ARC bridge) used to send and receive messages. |
| 62 class ArcBridgeService { | 63 class ArcBridgeService { |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 InstanceHolder<mojom::ObbMounterInstance>* obb_mounter() { | 124 InstanceHolder<mojom::ObbMounterInstance>* obb_mounter() { |
| 124 return &obb_mounter_; | 125 return &obb_mounter_; |
| 125 } | 126 } |
| 126 InstanceHolder<mojom::PolicyInstance>* policy() { return &policy_; } | 127 InstanceHolder<mojom::PolicyInstance>* policy() { return &policy_; } |
| 127 InstanceHolder<mojom::PowerInstance>* power() { return &power_; } | 128 InstanceHolder<mojom::PowerInstance>* power() { return &power_; } |
| 128 InstanceHolder<mojom::PrintInstance>* print() { return &print_; } | 129 InstanceHolder<mojom::PrintInstance>* print() { return &print_; } |
| 129 InstanceHolder<mojom::ProcessInstance>* process() { return &process_; } | 130 InstanceHolder<mojom::ProcessInstance>* process() { return &process_; } |
| 130 InstanceHolder<mojom::StorageManagerInstance>* storage_manager() { | 131 InstanceHolder<mojom::StorageManagerInstance>* storage_manager() { |
| 131 return &storage_manager_; | 132 return &storage_manager_; |
| 132 } | 133 } |
| 134 InstanceHolder<mojom::TraceInstance>* trace() { return &trace_; } |
| 133 InstanceHolder<mojom::TtsInstance>* tts() { return &tts_; } | 135 InstanceHolder<mojom::TtsInstance>* tts() { return &tts_; } |
| 134 InstanceHolder<mojom::VideoInstance>* video() { return &video_; } | 136 InstanceHolder<mojom::VideoInstance>* video() { return &video_; } |
| 135 InstanceHolder<mojom::WallpaperInstance>* wallpaper() { return &wallpaper_; } | 137 InstanceHolder<mojom::WallpaperInstance>* wallpaper() { return &wallpaper_; } |
| 136 | 138 |
| 137 // Gets if ARC is currently running. | 139 // Gets if ARC is currently running. |
| 138 bool ready() const { return state() == State::READY; } | 140 bool ready() const { return state() == State::READY; } |
| 139 | 141 |
| 140 // Gets if ARC is currently stopped. This is not exactly !ready() since there | 142 // Gets if ARC is currently stopped. This is not exactly !ready() since there |
| 141 // are transient states between ready() and stopped(). | 143 // are transient states between ready() and stopped(). |
| 142 bool stopped() const { return state() == State::STOPPED; } | 144 bool stopped() const { return state() == State::STOPPED; } |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 InstanceHolder<mojom::KioskInstance> kiosk_; | 194 InstanceHolder<mojom::KioskInstance> kiosk_; |
| 193 InstanceHolder<mojom::MetricsInstance> metrics_; | 195 InstanceHolder<mojom::MetricsInstance> metrics_; |
| 194 InstanceHolder<mojom::NetInstance> net_; | 196 InstanceHolder<mojom::NetInstance> net_; |
| 195 InstanceHolder<mojom::NotificationsInstance> notifications_; | 197 InstanceHolder<mojom::NotificationsInstance> notifications_; |
| 196 InstanceHolder<mojom::ObbMounterInstance> obb_mounter_; | 198 InstanceHolder<mojom::ObbMounterInstance> obb_mounter_; |
| 197 InstanceHolder<mojom::PolicyInstance> policy_; | 199 InstanceHolder<mojom::PolicyInstance> policy_; |
| 198 InstanceHolder<mojom::PowerInstance> power_; | 200 InstanceHolder<mojom::PowerInstance> power_; |
| 199 InstanceHolder<mojom::PrintInstance> print_; | 201 InstanceHolder<mojom::PrintInstance> print_; |
| 200 InstanceHolder<mojom::ProcessInstance> process_; | 202 InstanceHolder<mojom::ProcessInstance> process_; |
| 201 InstanceHolder<mojom::StorageManagerInstance> storage_manager_; | 203 InstanceHolder<mojom::StorageManagerInstance> storage_manager_; |
| 204 InstanceHolder<mojom::TraceInstance> trace_; |
| 202 InstanceHolder<mojom::TtsInstance> tts_; | 205 InstanceHolder<mojom::TtsInstance> tts_; |
| 203 InstanceHolder<mojom::VideoInstance> video_; | 206 InstanceHolder<mojom::VideoInstance> video_; |
| 204 InstanceHolder<mojom::WallpaperInstance> wallpaper_; | 207 InstanceHolder<mojom::WallpaperInstance> wallpaper_; |
| 205 | 208 |
| 206 // Gets the current state of the bridge service. | 209 // Gets the current state of the bridge service. |
| 207 State state() const { return state_; } | 210 State state() const { return state_; } |
| 208 | 211 |
| 209 // Changes the current state and notifies all observers. | 212 // Changes the current state and notifies all observers. |
| 210 void SetState(State state); | 213 void SetState(State state); |
| 211 | 214 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 241 | 244 |
| 242 // WeakPtrFactory to use callbacks. | 245 // WeakPtrFactory to use callbacks. |
| 243 base::WeakPtrFactory<ArcBridgeService> weak_factory_; | 246 base::WeakPtrFactory<ArcBridgeService> weak_factory_; |
| 244 | 247 |
| 245 DISALLOW_COPY_AND_ASSIGN(ArcBridgeService); | 248 DISALLOW_COPY_AND_ASSIGN(ArcBridgeService); |
| 246 }; | 249 }; |
| 247 | 250 |
| 248 } // namespace arc | 251 } // namespace arc |
| 249 | 252 |
| 250 #endif // COMPONENTS_ARC_ARC_BRIDGE_SERVICE_H_ | 253 #endif // COMPONENTS_ARC_ARC_BRIDGE_SERVICE_H_ |
| OLD | NEW |