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 ~ArcBridgeService() override; | 101 ~ArcBridgeService() override; |
99 | 102 |
100 // Gets the global instance of the ARC Bridge Service. This can only be | 103 // Gets the global instance of the ARC Bridge Service. This can only be |
101 // called on the thread that this class was created on. | 104 // called on the thread that this class was created on. |
102 static ArcBridgeService* Get(); | 105 static ArcBridgeService* Get(); |
103 | 106 |
(...skipping 25 matching lines...) Expand all Loading... |
129 // you want to be notified when this is ready. This can only be called on the | 132 // you want to be notified when this is ready. This can only be called on the |
130 // thread that this class was created on. | 133 // thread that this class was created on. |
131 AppInstance* app_instance() { return app_ptr_.get(); } | 134 AppInstance* app_instance() { return app_ptr_.get(); } |
132 InputInstance* input_instance() { return input_ptr_.get(); } | 135 InputInstance* input_instance() { return input_ptr_.get(); } |
133 NotificationsInstance* notifications_instance() { | 136 NotificationsInstance* notifications_instance() { |
134 return notifications_ptr_.get(); | 137 return notifications_ptr_.get(); |
135 } | 138 } |
136 PowerInstance* power_instance() { return power_ptr_.get(); } | 139 PowerInstance* power_instance() { return power_ptr_.get(); } |
137 ProcessInstance* process_instance() { return process_ptr_.get(); } | 140 ProcessInstance* process_instance() { return process_ptr_.get(); } |
138 SettingsInstance* settings_instance() { return settings_ptr_.get(); } | 141 SettingsInstance* settings_instance() { return settings_ptr_.get(); } |
| 142 VideoInstance* video_instance() { return video_ptr_.get(); } |
139 | 143 |
140 // ArcHost: | 144 // ArcHost: |
141 void OnAppInstanceReady(AppInstancePtr app_ptr) override; | 145 void OnAppInstanceReady(AppInstancePtr app_ptr) override; |
142 void OnInputInstanceReady(InputInstancePtr input_ptr) override; | 146 void OnInputInstanceReady(InputInstancePtr input_ptr) override; |
143 void OnNotificationsInstanceReady( | 147 void OnNotificationsInstanceReady( |
144 NotificationsInstancePtr notifications_ptr) override; | 148 NotificationsInstancePtr notifications_ptr) override; |
145 void OnPowerInstanceReady(PowerInstancePtr power_ptr) override; | 149 void OnPowerInstanceReady(PowerInstancePtr power_ptr) override; |
146 void OnProcessInstanceReady(ProcessInstancePtr process_ptr) override; | 150 void OnProcessInstanceReady(ProcessInstancePtr process_ptr) override; |
147 void OnSettingsInstanceReady(SettingsInstancePtr process_ptr) override; | 151 void OnSettingsInstanceReady(SettingsInstancePtr process_ptr) override; |
| 152 void OnVideoInstanceReady(VideoInstancePtr video_ptr) override; |
148 | 153 |
149 // Gets the current state of the bridge service. | 154 // Gets the current state of the bridge service. |
150 State state() const { return state_; } | 155 State state() const { return state_; } |
151 | 156 |
152 // Gets if ARC is available in this system. | 157 // Gets if ARC is available in this system. |
153 bool available() const { return available_; } | 158 bool available() const { return available_; } |
154 | 159 |
155 protected: | 160 protected: |
156 ArcBridgeService(); | 161 ArcBridgeService(); |
157 | 162 |
(...skipping 13 matching lines...) Expand all Loading... |
171 FRIEND_TEST_ALL_PREFIXES(ArcBridgeTest, Prerequisites); | 176 FRIEND_TEST_ALL_PREFIXES(ArcBridgeTest, Prerequisites); |
172 FRIEND_TEST_ALL_PREFIXES(ArcBridgeTest, ShutdownMidStartup); | 177 FRIEND_TEST_ALL_PREFIXES(ArcBridgeTest, ShutdownMidStartup); |
173 | 178 |
174 // Mojo interfaces. | 179 // Mojo interfaces. |
175 AppInstancePtr app_ptr_; | 180 AppInstancePtr app_ptr_; |
176 InputInstancePtr input_ptr_; | 181 InputInstancePtr input_ptr_; |
177 NotificationsInstancePtr notifications_ptr_; | 182 NotificationsInstancePtr notifications_ptr_; |
178 PowerInstancePtr power_ptr_; | 183 PowerInstancePtr power_ptr_; |
179 ProcessInstancePtr process_ptr_; | 184 ProcessInstancePtr process_ptr_; |
180 SettingsInstancePtr settings_ptr_; | 185 SettingsInstancePtr settings_ptr_; |
| 186 VideoInstancePtr video_ptr_; |
181 | 187 |
182 base::ObserverList<Observer> observer_list_; | 188 base::ObserverList<Observer> observer_list_; |
183 | 189 |
184 base::ThreadChecker thread_checker_; | 190 base::ThreadChecker thread_checker_; |
185 | 191 |
186 // If the ARC instance service is available. | 192 // If the ARC instance service is available. |
187 bool available_; | 193 bool available_; |
188 | 194 |
189 // The current state of the bridge. | 195 // The current state of the bridge. |
190 ArcBridgeService::State state_; | 196 ArcBridgeService::State state_; |
191 | 197 |
192 DISALLOW_COPY_AND_ASSIGN(ArcBridgeService); | 198 DISALLOW_COPY_AND_ASSIGN(ArcBridgeService); |
193 }; | 199 }; |
194 | 200 |
195 } // namespace arc | 201 } // namespace arc |
196 | 202 |
197 #endif // COMPONENTS_ARC_ARC_BRIDGE_SERVICE_H_ | 203 #endif // COMPONENTS_ARC_ARC_BRIDGE_SERVICE_H_ |
OLD | NEW |