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