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

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: Rebase 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
« no previous file with comments | « components/arc/arc_service_manager.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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(),
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;
114 services_.clear(); 109 services_.clear();
115 } 110 }
116 111
117 // static 112 // static
118 void ArcServiceManager::SetArcBridgeServiceForTesting( 113 void ArcServiceManager::SetArcBridgeServiceForTesting(
119 std::unique_ptr<ArcBridgeService> arc_bridge_service) { 114 std::unique_ptr<ArcBridgeService> arc_bridge_service) {
120 if (g_arc_bridge_service_for_testing) { 115 if (g_arc_bridge_service_for_testing) {
121 delete g_arc_bridge_service_for_testing; 116 delete g_arc_bridge_service_for_testing;
122 } 117 }
123 g_arc_bridge_service_for_testing = arc_bridge_service.release(); 118 g_arc_bridge_service_for_testing = arc_bridge_service.release();
124 } 119 }
125 120
126 } // namespace arc 121 } // namespace arc
OLDNEW
« no previous file with comments | « components/arc/arc_service_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698