| 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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 } | 107 } |
| 108 InstanceHolder<mojom::ObbMounterInstance>* obb_mounter() { | 108 InstanceHolder<mojom::ObbMounterInstance>* obb_mounter() { |
| 109 return &obb_mounter_; | 109 return &obb_mounter_; |
| 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::ProcessInstance>* process() { return &process_; } | 113 InstanceHolder<mojom::ProcessInstance>* process() { return &process_; } |
| 114 InstanceHolder<mojom::StorageManagerInstance>* storage_manager() { | 114 InstanceHolder<mojom::StorageManagerInstance>* storage_manager() { |
| 115 return &storage_manager_; | 115 return &storage_manager_; |
| 116 } | 116 } |
| 117 InstanceHolder<mojom::TtsInstance>* tts() { return &tts_; } |
| 117 InstanceHolder<mojom::VideoInstance>* video() { return &video_; } | 118 InstanceHolder<mojom::VideoInstance>* video() { return &video_; } |
| 118 | 119 |
| 119 // Gets if ARC is currently running. | 120 // Gets if ARC is currently running. |
| 120 bool ready() const { return state() == State::READY; } | 121 bool ready() const { return state() == State::READY; } |
| 121 | 122 |
| 122 // Gets if ARC is currently stopped. This is not exactly !ready() since there | 123 // Gets if ARC is currently stopped. This is not exactly !ready() since there |
| 123 // are transient states between ready() and stopped(). | 124 // are transient states between ready() and stopped(). |
| 124 bool stopped() const { return state() == State::STOPPED; } | 125 bool stopped() const { return state() == State::STOPPED; } |
| 125 | 126 |
| 126 protected: | 127 protected: |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 InstanceHolder<mojom::ImeInstance> ime_; | 174 InstanceHolder<mojom::ImeInstance> ime_; |
| 174 InstanceHolder<mojom::IntentHelperInstance> intent_helper_; | 175 InstanceHolder<mojom::IntentHelperInstance> intent_helper_; |
| 175 InstanceHolder<mojom::MetricsInstance> metrics_; | 176 InstanceHolder<mojom::MetricsInstance> metrics_; |
| 176 InstanceHolder<mojom::NetInstance> net_; | 177 InstanceHolder<mojom::NetInstance> net_; |
| 177 InstanceHolder<mojom::NotificationsInstance> notifications_; | 178 InstanceHolder<mojom::NotificationsInstance> notifications_; |
| 178 InstanceHolder<mojom::ObbMounterInstance> obb_mounter_; | 179 InstanceHolder<mojom::ObbMounterInstance> obb_mounter_; |
| 179 InstanceHolder<mojom::PolicyInstance> policy_; | 180 InstanceHolder<mojom::PolicyInstance> policy_; |
| 180 InstanceHolder<mojom::PowerInstance> power_; | 181 InstanceHolder<mojom::PowerInstance> power_; |
| 181 InstanceHolder<mojom::ProcessInstance> process_; | 182 InstanceHolder<mojom::ProcessInstance> process_; |
| 182 InstanceHolder<mojom::StorageManagerInstance> storage_manager_; | 183 InstanceHolder<mojom::StorageManagerInstance> storage_manager_; |
| 184 InstanceHolder<mojom::TtsInstance> tts_; |
| 183 InstanceHolder<mojom::VideoInstance> video_; | 185 InstanceHolder<mojom::VideoInstance> video_; |
| 184 | 186 |
| 185 // Gets the current state of the bridge service. | 187 // Gets the current state of the bridge service. |
| 186 State state() const { return state_; } | 188 State state() const { return state_; } |
| 187 | 189 |
| 188 // Changes the current state and notifies all observers. | 190 // Changes the current state and notifies all observers. |
| 189 void SetState(State state); | 191 void SetState(State state); |
| 190 | 192 |
| 191 // Sets the reason the bridge is stopped. This function must be always called | 193 // Sets the reason the bridge is stopped. This function must be always called |
| 192 // before SetState(State::STOPPED) to report a correct reason with | 194 // before SetState(State::STOPPED) to report a correct reason with |
| (...skipping 24 matching lines...) Expand all Loading... |
| 217 | 219 |
| 218 // WeakPtrFactory to use callbacks. | 220 // WeakPtrFactory to use callbacks. |
| 219 base::WeakPtrFactory<ArcBridgeService> weak_factory_; | 221 base::WeakPtrFactory<ArcBridgeService> weak_factory_; |
| 220 | 222 |
| 221 DISALLOW_COPY_AND_ASSIGN(ArcBridgeService); | 223 DISALLOW_COPY_AND_ASSIGN(ArcBridgeService); |
| 222 }; | 224 }; |
| 223 | 225 |
| 224 } // namespace arc | 226 } // namespace arc |
| 225 | 227 |
| 226 #endif // COMPONENTS_ARC_ARC_BRIDGE_SERVICE_H_ | 228 #endif // COMPONENTS_ARC_ARC_BRIDGE_SERVICE_H_ |
| OLD | NEW |