Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(217)

Side by Side Diff: components/arc/arc_service_manager.cc

Issue 2209173002: Migrate ArcUserDataService into ArcAuthService. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added more comments. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 void ArcServiceManager::AddService(std::unique_ptr<ArcService> service) { 92 void ArcServiceManager::AddService(std::unique_ptr<ArcService> service) {
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
103 arc_user_data_service_.reset(new ArcUserDataService(arc_bridge_service(),
Luis Héctor Chávez 2016/08/09 16:40:02 Wouldn't this break https://cs.chromium.org/chromi
hidehiko 2016/08/10 05:41:19 In new code, it doesn't use ArcUserDataService, so
Luis Héctor Chávez 2016/08/10 06:25:48 can you remove the getter? it will now be useless
hidehiko 2016/08/10 17:26:06 Ok. Done. Father clean up will be done in a follow
104 std::move(arc_enabled_pref), account_id));
105
106 AddService(base::WrapUnique( 102 AddService(base::WrapUnique(
107 new ArcNotificationManager(arc_bridge_service(), account_id))); 103 new ArcNotificationManager(arc_bridge_service(), account_id)));
108 } 104 }
109 105
110 void ArcServiceManager::Shutdown() { 106 void ArcServiceManager::Shutdown() {
111 icon_loader_ = nullptr; 107 icon_loader_ = nullptr;
112 activity_resolver_ = nullptr; 108 activity_resolver_ = nullptr;
113 arc_user_data_service_ = nullptr; 109 arc_user_data_service_ = nullptr;
114 services_.clear(); 110 services_.clear();
115 } 111 }
116 112
117 // static 113 // static
118 void ArcServiceManager::SetArcBridgeServiceForTesting( 114 void ArcServiceManager::SetArcBridgeServiceForTesting(
119 std::unique_ptr<ArcBridgeService> arc_bridge_service) { 115 std::unique_ptr<ArcBridgeService> arc_bridge_service) {
120 if (g_arc_bridge_service_for_testing) { 116 if (g_arc_bridge_service_for_testing) {
121 delete g_arc_bridge_service_for_testing; 117 delete g_arc_bridge_service_for_testing;
122 } 118 }
123 g_arc_bridge_service_for_testing = arc_bridge_service.release(); 119 g_arc_bridge_service_for_testing = arc_bridge_service.release();
124 } 120 }
125 121
126 } // namespace arc 122 } // namespace arc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698