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 #include "components/arc/arc_service_manager.h" | 5 #include "components/arc/arc_service_manager.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 | 26 |
27 } // namespace | 27 } // namespace |
28 | 28 |
29 class ArcServiceManager::IntentHelperObserverImpl | 29 class ArcServiceManager::IntentHelperObserverImpl |
30 : public ArcIntentHelperObserver { | 30 : public ArcIntentHelperObserver { |
31 public: | 31 public: |
32 explicit IntentHelperObserverImpl(ArcServiceManager* manager); | 32 explicit IntentHelperObserverImpl(ArcServiceManager* manager); |
33 ~IntentHelperObserverImpl() override = default; | 33 ~IntentHelperObserverImpl() override = default; |
34 | 34 |
35 private: | 35 private: |
36 void OnAppsUpdated() override; | 36 void OnIntentFiltersUpdated() override; |
37 ArcServiceManager* const manager_; | 37 ArcServiceManager* const manager_; |
38 | 38 |
39 DISALLOW_COPY_AND_ASSIGN(IntentHelperObserverImpl); | 39 DISALLOW_COPY_AND_ASSIGN(IntentHelperObserverImpl); |
40 }; | 40 }; |
41 | 41 |
42 ArcServiceManager::IntentHelperObserverImpl::IntentHelperObserverImpl( | 42 ArcServiceManager::IntentHelperObserverImpl::IntentHelperObserverImpl( |
43 ArcServiceManager* manager) | 43 ArcServiceManager* manager) |
44 : manager_(manager) {} | 44 : manager_(manager) {} |
45 | 45 |
46 void ArcServiceManager::IntentHelperObserverImpl::OnAppsUpdated() { | 46 void ArcServiceManager::IntentHelperObserverImpl::OnIntentFiltersUpdated() { |
47 DCHECK(manager_->thread_checker_.CalledOnValidThread()); | 47 DCHECK(manager_->thread_checker_.CalledOnValidThread()); |
48 for (auto& observer : manager_->observer_list_) | 48 for (auto& observer : manager_->observer_list_) |
49 observer.OnAppsUpdated(); | 49 observer.OnIntentFiltersUpdated(); |
50 } | 50 } |
51 | 51 |
52 ArcServiceManager::ArcServiceManager( | 52 ArcServiceManager::ArcServiceManager( |
53 scoped_refptr<base::TaskRunner> blocking_task_runner) | 53 scoped_refptr<base::TaskRunner> blocking_task_runner) |
54 : blocking_task_runner_(blocking_task_runner), | 54 : blocking_task_runner_(blocking_task_runner), |
55 intent_helper_observer_(base::MakeUnique<IntentHelperObserverImpl>(this)), | 55 intent_helper_observer_(base::MakeUnique<IntentHelperObserverImpl>(this)), |
56 icon_loader_(new ActivityIconLoader()), | 56 icon_loader_(new ActivityIconLoader()), |
57 activity_resolver_(new LocalActivityResolver()) { | 57 activity_resolver_(new LocalActivityResolver()) { |
58 DCHECK(!g_arc_service_manager); | 58 DCHECK(!g_arc_service_manager); |
59 g_arc_service_manager = this; | 59 g_arc_service_manager = this; |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 | 121 |
122 // static | 122 // static |
123 void ArcServiceManager::SetArcBridgeServiceForTesting( | 123 void ArcServiceManager::SetArcBridgeServiceForTesting( |
124 std::unique_ptr<ArcBridgeService> arc_bridge_service) { | 124 std::unique_ptr<ArcBridgeService> arc_bridge_service) { |
125 if (g_arc_bridge_service_for_testing) | 125 if (g_arc_bridge_service_for_testing) |
126 delete g_arc_bridge_service_for_testing; | 126 delete g_arc_bridge_service_for_testing; |
127 g_arc_bridge_service_for_testing = arc_bridge_service.release(); | 127 g_arc_bridge_service_for_testing = arc_bridge_service.release(); |
128 } | 128 } |
129 | 129 |
130 } // namespace arc | 130 } // namespace arc |
OLD | NEW |