| 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/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "base/sequenced_task_runner.h" | 10 #include "base/sequenced_task_runner.h" |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 } | 91 } |
| 92 | 92 |
| 93 void ArcServiceManager::AddService(std::unique_ptr<ArcService> service) { | 93 void ArcServiceManager::AddService(std::unique_ptr<ArcService> service) { |
| 94 DCHECK(thread_checker_.CalledOnValidThread()); | 94 DCHECK(thread_checker_.CalledOnValidThread()); |
| 95 | 95 |
| 96 services_.emplace_back(std::move(service)); | 96 services_.emplace_back(std::move(service)); |
| 97 } | 97 } |
| 98 | 98 |
| 99 void ArcServiceManager::OnPrimaryUserProfilePrepared( | 99 void ArcServiceManager::OnPrimaryUserProfilePrepared( |
| 100 const AccountId& account_id, | 100 const AccountId& account_id, |
| 101 std::unique_ptr<BooleanPrefMember> arc_enabled_pref) { | 101 std::unique_ptr<BooleanPrefMember> arc_enabled_pref, |
| 102 PrefService* pref_service) { |
| 102 DCHECK(thread_checker_.CalledOnValidThread()); | 103 DCHECK(thread_checker_.CalledOnValidThread()); |
| 103 | 104 |
| 104 AddService(base::WrapUnique(new ArcUserDataService( | 105 AddService(base::WrapUnique(new ArcUserDataService( |
| 105 arc_bridge_service(), std::move(arc_enabled_pref), account_id))); | 106 arc_bridge_service(), std::move(arc_enabled_pref), pref_service, |
| 107 account_id))); |
| 106 | 108 |
| 107 AddService(base::WrapUnique( | 109 AddService(base::WrapUnique( |
| 108 new ArcNotificationManager(arc_bridge_service(), account_id))); | 110 new ArcNotificationManager(arc_bridge_service(), account_id))); |
| 109 } | 111 } |
| 110 | 112 |
| 111 void ArcServiceManager::OnAshStarted() { | 113 void ArcServiceManager::OnAshStarted() { |
| 112 DCHECK(thread_checker_.CalledOnValidThread()); | 114 DCHECK(thread_checker_.CalledOnValidThread()); |
| 113 // We might come here multiple times. As such we should only do this once. | 115 // We might come here multiple times. As such we should only do this once. |
| 114 if (on_ash_started_called_) | 116 if (on_ash_started_called_) |
| 115 return; | 117 return; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 128 // static | 130 // static |
| 129 void ArcServiceManager::SetArcBridgeServiceForTesting( | 131 void ArcServiceManager::SetArcBridgeServiceForTesting( |
| 130 std::unique_ptr<ArcBridgeService> arc_bridge_service) { | 132 std::unique_ptr<ArcBridgeService> arc_bridge_service) { |
| 131 if (g_arc_bridge_service_for_testing) { | 133 if (g_arc_bridge_service_for_testing) { |
| 132 delete g_arc_bridge_service_for_testing; | 134 delete g_arc_bridge_service_for_testing; |
| 133 } | 135 } |
| 134 g_arc_bridge_service_for_testing = arc_bridge_service.release(); | 136 g_arc_bridge_service_for_testing = arc_bridge_service.release(); |
| 135 } | 137 } |
| 136 | 138 |
| 137 } // namespace arc | 139 } // namespace arc |
| OLD | NEW |