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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 | 84 |
85 // Called whenever the ARC power is ready. | 85 // Called whenever the ARC power is ready. |
86 virtual void OnPowerInstanceReady() {} | 86 virtual void OnPowerInstanceReady() {} |
87 | 87 |
88 // Called whenever the ARC process is ready. | 88 // Called whenever the ARC process is ready. |
89 virtual void OnProcessInstanceReady() {} | 89 virtual void OnProcessInstanceReady() {} |
90 | 90 |
91 // Called whenever the ARC settings is ready. | 91 // Called whenever the ARC settings is ready. |
92 virtual void OnSettingsInstanceReady() {} | 92 virtual void OnSettingsInstanceReady() {} |
93 | 93 |
| 94 // Called whenever the ARC video is ready. |
| 95 virtual void OnVideoInstanceReady() {} |
| 96 |
94 protected: | 97 protected: |
95 virtual ~Observer() {} | 98 virtual ~Observer() {} |
96 }; | 99 }; |
97 | 100 |
98 // Notifies power management-related events. | 101 // Notifies power management-related events. |
99 class PowerObserver { | 102 class PowerObserver { |
100 public: | 103 public: |
101 // Called whenever ARC requests a wake lock. | 104 // Called whenever ARC requests a wake lock. |
102 virtual void OnAcquireDisplayWakeLock(DisplayWakeLockType type) {} | 105 virtual void OnAcquireDisplayWakeLock(DisplayWakeLockType type) {} |
103 | 106 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 // you want to be notified when this is ready. This can only be called on the | 145 // you want to be notified when this is ready. This can only be called on the |
143 // thread that this class was created on. | 146 // thread that this class was created on. |
144 AppInstance* app_instance() { return app_ptr_.get(); } | 147 AppInstance* app_instance() { return app_ptr_.get(); } |
145 InputInstance* input_instance() { return input_ptr_.get(); } | 148 InputInstance* input_instance() { return input_ptr_.get(); } |
146 NotificationsInstance* notifications_instance() { | 149 NotificationsInstance* notifications_instance() { |
147 return notifications_ptr_.get(); | 150 return notifications_ptr_.get(); |
148 } | 151 } |
149 PowerInstance* power_instance() { return power_ptr_.get(); } | 152 PowerInstance* power_instance() { return power_ptr_.get(); } |
150 ProcessInstance* process_instance() { return process_ptr_.get(); } | 153 ProcessInstance* process_instance() { return process_ptr_.get(); } |
151 SettingsInstance* settings_instance() { return settings_ptr_.get(); } | 154 SettingsInstance* settings_instance() { return settings_ptr_.get(); } |
| 155 VideoInstance* video_instance() { return video_ptr_.get(); } |
152 | 156 |
153 // ArcHost: | 157 // ArcHost: |
154 void OnAppInstanceReady(AppInstancePtr app_ptr) override; | 158 void OnAppInstanceReady(AppInstancePtr app_ptr) override; |
155 void OnInputInstanceReady(InputInstancePtr input_ptr) override; | 159 void OnInputInstanceReady(InputInstancePtr input_ptr) override; |
156 void OnNotificationsInstanceReady( | 160 void OnNotificationsInstanceReady( |
157 NotificationsInstancePtr notifications_ptr) override; | 161 NotificationsInstancePtr notifications_ptr) override; |
158 void OnPowerInstanceReady(PowerInstancePtr power_ptr) override; | 162 void OnPowerInstanceReady(PowerInstancePtr power_ptr) override; |
159 void OnProcessInstanceReady(ProcessInstancePtr process_ptr) override; | 163 void OnProcessInstanceReady(ProcessInstancePtr process_ptr) override; |
160 void OnSettingsInstanceReady(SettingsInstancePtr process_ptr) override; | 164 void OnSettingsInstanceReady(SettingsInstancePtr process_ptr) override; |
| 165 void OnVideoInstanceReady(VideoInstancePtr video_ptr) override; |
161 | 166 |
162 // Gets the current state of the bridge service. | 167 // Gets the current state of the bridge service. |
163 State state() const { return state_; } | 168 State state() const { return state_; } |
164 | 169 |
165 // Gets if ARC is available in this system. | 170 // Gets if ARC is available in this system. |
166 bool available() const { return available_; } | 171 bool available() const { return available_; } |
167 | 172 |
168 protected: | 173 protected: |
169 ArcBridgeService(); | 174 ArcBridgeService(); |
170 | 175 |
(...skipping 13 matching lines...) Expand all Loading... |
184 FRIEND_TEST_ALL_PREFIXES(ArcBridgeTest, Prerequisites); | 189 FRIEND_TEST_ALL_PREFIXES(ArcBridgeTest, Prerequisites); |
185 FRIEND_TEST_ALL_PREFIXES(ArcBridgeTest, ShutdownMidStartup); | 190 FRIEND_TEST_ALL_PREFIXES(ArcBridgeTest, ShutdownMidStartup); |
186 | 191 |
187 // Mojo interfaces. | 192 // Mojo interfaces. |
188 AppInstancePtr app_ptr_; | 193 AppInstancePtr app_ptr_; |
189 InputInstancePtr input_ptr_; | 194 InputInstancePtr input_ptr_; |
190 NotificationsInstancePtr notifications_ptr_; | 195 NotificationsInstancePtr notifications_ptr_; |
191 PowerInstancePtr power_ptr_; | 196 PowerInstancePtr power_ptr_; |
192 ProcessInstancePtr process_ptr_; | 197 ProcessInstancePtr process_ptr_; |
193 SettingsInstancePtr settings_ptr_; | 198 SettingsInstancePtr settings_ptr_; |
| 199 VideoInstancePtr video_ptr_; |
194 | 200 |
195 base::ObserverList<Observer> observer_list_; | 201 base::ObserverList<Observer> observer_list_; |
196 | 202 |
197 base::ThreadChecker thread_checker_; | 203 base::ThreadChecker thread_checker_; |
198 | 204 |
199 // If the ARC instance service is available. | 205 // If the ARC instance service is available. |
200 bool available_; | 206 bool available_; |
201 | 207 |
202 // The current state of the bridge. | 208 // The current state of the bridge. |
203 ArcBridgeService::State state_; | 209 ArcBridgeService::State state_; |
204 | 210 |
205 DISALLOW_COPY_AND_ASSIGN(ArcBridgeService); | 211 DISALLOW_COPY_AND_ASSIGN(ArcBridgeService); |
206 }; | 212 }; |
207 | 213 |
208 } // namespace arc | 214 } // namespace arc |
209 | 215 |
210 #endif // COMPONENTS_ARC_ARC_BRIDGE_SERVICE_H_ | 216 #endif // COMPONENTS_ARC_ARC_BRIDGE_SERVICE_H_ |
OLD | NEW |