| 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 public: | 71 public: |
| 72 // Called whenever the state of the bridge has changed. | 72 // Called whenever the state of the bridge has changed. |
| 73 virtual void OnStateChanged(State state) {} | 73 virtual void OnStateChanged(State state) {} |
| 74 | 74 |
| 75 // Called when the instance has reached a boot phase | 75 // Called when the instance has reached a boot phase |
| 76 virtual void OnInstanceBootPhase(InstanceBootPhase phase) {} | 76 virtual void OnInstanceBootPhase(InstanceBootPhase phase) {} |
| 77 | 77 |
| 78 // Called whenever ARC's availability has changed for this system. | 78 // Called whenever ARC's availability has changed for this system. |
| 79 virtual void OnAvailableChanged(bool available) {} | 79 virtual void OnAvailableChanged(bool available) {} |
| 80 | 80 |
| 81 // Called whenever the ARC video is ready. |
| 82 virtual void OnVideoInstanceReady() {} |
| 83 |
| 81 protected: | 84 protected: |
| 82 virtual ~Observer() {} | 85 virtual ~Observer() {} |
| 83 }; | 86 }; |
| 84 | 87 |
| 85 class NotificationObserver { | 88 class NotificationObserver { |
| 86 public: | 89 public: |
| 87 // Called whenever a notification has been posted on Android side. This | 90 // Called whenever a notification has been posted on Android side. This |
| 88 // event is used for both creation and update. | 91 // event is used for both creation and update. |
| 89 virtual void OnNotificationPostedFromAndroid( | 92 virtual void OnNotificationPostedFromAndroid( |
| 90 const ArcNotificationData& data) {} | 93 const ArcNotificationData& data) {} |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 // Adds or removes ARC app observers. This can only be called on the thread | 166 // Adds or removes ARC app observers. This can only be called on the thread |
| 164 // that this class was created on. | 167 // that this class was created on. |
| 165 void AddAppObserver(AppObserver* observer); | 168 void AddAppObserver(AppObserver* observer); |
| 166 void RemoveAppObserver(AppObserver* observer); | 169 void RemoveAppObserver(AppObserver* observer); |
| 167 | 170 |
| 168 // Adds or removes ARC process observers. This can only be called on the | 171 // Adds or removes ARC process observers. This can only be called on the |
| 169 // thread that this class was created on. | 172 // thread that this class was created on. |
| 170 void AddProcessObserver(ProcessObserver* observer); | 173 void AddProcessObserver(ProcessObserver* observer); |
| 171 void RemoveProcessObserver(ProcessObserver* observer); | 174 void RemoveProcessObserver(ProcessObserver* observer); |
| 172 | 175 |
| 176 virtual VideoInstance* video_instance() = 0; |
| 177 |
| 173 // Gets the current state of the bridge service. | 178 // Gets the current state of the bridge service. |
| 174 State state() const { return state_; } | 179 State state() const { return state_; } |
| 175 | 180 |
| 176 // Gets if ARC is available in this system. | 181 // Gets if ARC is available in this system. |
| 177 bool available() const { return available_; } | 182 bool available() const { return available_; } |
| 178 | 183 |
| 179 // Requests registration of an input device on the ARC instance. | 184 // Requests registration of an input device on the ARC instance. |
| 180 // TODO(denniskempin): Make this interface more typesafe. | 185 // TODO(denniskempin): Make this interface more typesafe. |
| 181 // |name| should be the displayable name of the emulated device (e.g. "Chrome | 186 // |name| should be the displayable name of the emulated device (e.g. "Chrome |
| 182 // OS Keyboard"), |device_type| the name of the device type (e.g. "keyboard") | 187 // OS Keyboard"), |device_type| the name of the device type (e.g. "keyboard") |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 | 265 |
| 261 // The current state of the bridge. | 266 // The current state of the bridge. |
| 262 ArcBridgeService::State state_; | 267 ArcBridgeService::State state_; |
| 263 | 268 |
| 264 DISALLOW_COPY_AND_ASSIGN(ArcBridgeService); | 269 DISALLOW_COPY_AND_ASSIGN(ArcBridgeService); |
| 265 }; | 270 }; |
| 266 | 271 |
| 267 } // namespace arc | 272 } // namespace arc |
| 268 | 273 |
| 269 #endif // COMPONENTS_ARC_ARC_BRIDGE_SERVICE_H_ | 274 #endif // COMPONENTS_ARC_ARC_BRIDGE_SERVICE_H_ |
| OLD | NEW |