Chromium Code Reviews| Index: components/arc/arc_bridge_service.h | 
| diff --git a/components/arc/arc_bridge_service.h b/components/arc/arc_bridge_service.h | 
| index 78e8fa8d2bfbdcd08b6c745895975e0a0ac3a3d7..94195dea4d6640406c5bda57a2f86b67b55223ed 100644 | 
| --- a/components/arc/arc_bridge_service.h | 
| +++ b/components/arc/arc_bridge_service.h | 
| @@ -64,6 +64,7 @@ class ArcBridgeService { | 
| STOPPING, | 
| }; | 
| + // Notifies life cycle events of ArcBridgeService. | 
| class Observer { | 
| public: | 
| // Called whenever the state of the bridge has changed. | 
| @@ -79,6 +80,22 @@ class ArcBridgeService { | 
| virtual ~Observer() {} | 
| }; | 
| + // Notifies ARC apps related events. | 
| + class AppsObserver { | 
| 
 
hidehiko
2015/12/01 08:18:25
nit: I prefer AppObserver, as this also receives i
 
khmel1
2015/12/01 09:49:32
Sounds better, thanks
 
 | 
| + public: | 
| 
 
hidehiko
2015/12/01 08:18:25
nit: indent.
 
khmel1
2015/12/01 09:49:32
Done.
 
 | 
| + // Called whenever ARC sends information about available apps. | 
| + virtual void OnAppsRefreshed(const std::vector<AppInfo>& apps) {} | 
| + | 
| + // Called whenever ARC sends app icon data for specific scale factor. | 
| + virtual void OnAppIcon(const std::string& package, | 
| + const std::string& activity, | 
| + int scale_factor, | 
| + const std::vector<uint8_t>& icon_png_data) {} | 
| + | 
| + protected: | 
| + virtual ~AppsObserver() {} | 
| + }; | 
| + | 
| virtual ~ArcBridgeService(); | 
| // Creates instance of |ArcBridgeService| for normal use. | 
| @@ -113,6 +130,11 @@ class ArcBridgeService { | 
| void AddObserver(Observer* observer); | 
| void RemoveObserver(Observer* observer); | 
| + // Adds or removes ARC apps observers. This can only be called on the thread | 
| + // that this class was created on. | 
| + void AddAppsObserver(AppsObserver* observer); | 
| + void RemoveAppsObserver(AppsObserver* observer); | 
| + | 
| // Gets the current state of the bridge service. | 
| State state() const { return state_; } | 
| @@ -129,6 +151,18 @@ class ArcBridgeService { | 
| const std::string& device_type, | 
| base::ScopedFD fd) = 0; | 
| + // Requests to refresh an app list. | 
| + virtual bool RefreshApps() = 0; | 
| 
 
hidehiko
2015/12/01 08:18:25
nit: Then, as you've written, how about name it Re
 
khmel1
2015/12/01 09:49:32
Agree
 
 | 
| + | 
| + // Requests to launch an app. | 
| + virtual bool LaunchApp(const std::string& package, | 
| + const std::string& activity) = 0; | 
| + | 
| + // Request to load icon of specific scale_factor. | 
| + virtual bool RequestIcon(const std::string& package, | 
| + const std::string& activity, | 
| + int scale_factor) = 0; | 
| + | 
| protected: | 
| ArcBridgeService(); | 
| @@ -144,11 +178,17 @@ class ArcBridgeService { | 
| base::ObserverList<Observer>& observer_list() { return observer_list_; } | 
| + base::ObserverList<AppsObserver>& apps_observer_list() { | 
| + return apps_observer_list_; | 
| + } | 
| + | 
| private: | 
| scoped_refptr<base::SequencedTaskRunner> origin_task_runner_; | 
| base::ObserverList<Observer> observer_list_; | 
| + base::ObserverList<AppsObserver> apps_observer_list_; | 
| + | 
| // If the ARC instance service is available. | 
| bool available_; |