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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
93 DCHECK(thread_checker_.CalledOnValidThread()); | 93 DCHECK(thread_checker_.CalledOnValidThread()); |
94 | 94 |
95 services_.emplace_back(std::move(service)); | 95 services_.emplace_back(std::move(service)); |
96 } | 96 } |
97 | 97 |
98 void ArcServiceManager::OnPrimaryUserProfilePrepared( | 98 void ArcServiceManager::OnPrimaryUserProfilePrepared( |
99 const AccountId& account_id, | 99 const AccountId& account_id, |
100 std::unique_ptr<BooleanPrefMember> arc_enabled_pref) { | 100 std::unique_ptr<BooleanPrefMember> arc_enabled_pref) { |
101 DCHECK(thread_checker_.CalledOnValidThread()); | 101 DCHECK(thread_checker_.CalledOnValidThread()); |
102 | 102 |
103 AddService(base::WrapUnique(new ArcUserDataService( | 103 arc_user_data_service_.reset(new ArcUserDataService(arc_bridge_service(), |
104 arc_bridge_service(), std::move(arc_enabled_pref), account_id))); | 104 std::move(arc_enabled_pref), account_id)); |
105 | 105 |
106 AddService(base::WrapUnique( | 106 AddService(base::WrapUnique( |
107 new ArcNotificationManager(arc_bridge_service(), account_id))); | 107 new ArcNotificationManager(arc_bridge_service(), account_id))); |
108 } | 108 } |
109 | 109 |
110 void ArcServiceManager::Shutdown() { | 110 void ArcServiceManager::Shutdown() { |
111 icon_loader_ = nullptr; | 111 icon_loader_ = nullptr; |
112 activity_resolver_ = nullptr; | 112 activity_resolver_ = nullptr; |
113 services_.clear(); | 113 services_.clear(); |
114 arc_user_data_service_ = nullptr; | |
Luis Héctor Chávez
2016/07/25 17:40:33
nit: move this one line above (and remove the extr
Polina Bondarenko
2016/07/25 20:03:31
Done.
| |
114 } | 115 } |
115 | 116 |
116 // static | 117 // static |
117 void ArcServiceManager::SetArcBridgeServiceForTesting( | 118 void ArcServiceManager::SetArcBridgeServiceForTesting( |
118 std::unique_ptr<ArcBridgeService> arc_bridge_service) { | 119 std::unique_ptr<ArcBridgeService> arc_bridge_service) { |
119 if (g_arc_bridge_service_for_testing) { | 120 if (g_arc_bridge_service_for_testing) { |
120 delete g_arc_bridge_service_for_testing; | 121 delete g_arc_bridge_service_for_testing; |
121 } | 122 } |
122 g_arc_bridge_service_for_testing = arc_bridge_service.release(); | 123 g_arc_bridge_service_for_testing = arc_bridge_service.release(); |
123 } | 124 } |
124 | 125 |
125 } // namespace arc | 126 } // namespace arc |
OLD | NEW |