Chromium Code Reviews| Index: components/arc/arc_service_manager.cc |
| diff --git a/components/arc/arc_service_manager.cc b/components/arc/arc_service_manager.cc |
| index 9642d9f40d16801672933118e22b7cc1851aa1b3..e4abeefb2704d15964f56e013a88edcb9f0a2c73 100644 |
| --- a/components/arc/arc_service_manager.cc |
| +++ b/components/arc/arc_service_manager.cc |
| @@ -11,6 +11,7 @@ |
| #include "base/threading/thread_task_runner_handle.h" |
| #include "components/arc/arc_bridge_service.h" |
| #include "components/arc/arc_bridge_service_impl.h" |
| +#include "components/arc/intent_helper/arc_intent_helper_observer.h" |
| namespace arc { |
| @@ -24,9 +25,32 @@ ArcBridgeService* g_arc_bridge_service_for_testing = nullptr; |
| } // namespace |
| +class ArcServiceManager::IntentHelperObserverImpl |
| + : public ArcIntentHelperObserver { |
| + public: |
| + explicit IntentHelperObserverImpl(ArcServiceManager* manager); |
| + ~IntentHelperObserverImpl() override = default; |
| + |
| + private: |
| + void OnAppsUpdated() override; |
| + ArcServiceManager* const manager_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(IntentHelperObserverImpl); |
| +}; |
| + |
| +ArcServiceManager::IntentHelperObserverImpl::IntentHelperObserverImpl( |
| + ArcServiceManager* manager) |
| + : manager_(manager) {} |
| + |
| +void ArcServiceManager::IntentHelperObserverImpl::OnAppsUpdated() { |
| + for (auto& observer : manager_->observer_list_) |
|
hidehiko
2016/12/14 09:06:08
In C++, it is not allowed to access a private memb
hidehiko
2016/12/14 09:11:01
On, wait. My knowledge was old. I've just learnt C
|
| + observer.OnAppsUpdated(); |
| +} |
| + |
| ArcServiceManager::ArcServiceManager( |
| scoped_refptr<base::TaskRunner> blocking_task_runner) |
| : blocking_task_runner_(blocking_task_runner), |
| + intent_helper_observer_(base::MakeUnique<IntentHelperObserverImpl>(this)), |
| icon_loader_(new ActivityIconLoader()), |
| activity_resolver_(new LocalActivityResolver()) { |
| DCHECK(!g_arc_service_manager); |
| @@ -79,11 +103,6 @@ void ArcServiceManager::RemoveObserver(Observer* observer) { |
| observer_list_.RemoveObserver(observer); |
| } |
| -void ArcServiceManager::OnAppsUpdated() { |
| - for (auto& observer : observer_list_) |
| - observer.OnAppsUpdated(); |
| -} |
| - |
| void ArcServiceManager::Shutdown() { |
| icon_loader_ = nullptr; |
| activity_resolver_ = nullptr; |