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

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

Issue 2255673004: Revert of [M53 cherry-pick] Migrate ArcUserDataService into ArcAuthService. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2785
Patch Set: 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 "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "base/sequenced_task_runner.h" 8 #include "base/sequenced_task_runner.h"
9 #include "base/threading/thread_task_runner_handle.h" 9 #include "base/threading/thread_task_runner_handle.h"
10 #include "components/arc/arc_bridge_bootstrap.h" 10 #include "components/arc/arc_bridge_bootstrap.h"
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 void ArcServiceManager::AddService(std::unique_ptr<ArcService> service) { 91 void ArcServiceManager::AddService(std::unique_ptr<ArcService> service) {
92 DCHECK(thread_checker_.CalledOnValidThread()); 92 DCHECK(thread_checker_.CalledOnValidThread());
93 93
94 services_.emplace_back(std::move(service)); 94 services_.emplace_back(std::move(service));
95 } 95 }
96 96
97 void ArcServiceManager::OnPrimaryUserProfilePrepared( 97 void ArcServiceManager::OnPrimaryUserProfilePrepared(
98 const AccountId& account_id, 98 const AccountId& account_id,
99 std::unique_ptr<BooleanPrefMember> arc_enabled_pref) { 99 std::unique_ptr<BooleanPrefMember> arc_enabled_pref) {
100 DCHECK(thread_checker_.CalledOnValidThread()); 100 DCHECK(thread_checker_.CalledOnValidThread());
101
102 arc_user_data_service_.reset(new ArcUserDataService(arc_bridge_service(),
103 std::move(arc_enabled_pref), account_id));
104
101 AddService(base::WrapUnique( 105 AddService(base::WrapUnique(
102 new ArcNotificationManager(arc_bridge_service(), account_id))); 106 new ArcNotificationManager(arc_bridge_service(), account_id)));
103 } 107 }
104 108
105 void ArcServiceManager::OnAshStarted() { 109 void ArcServiceManager::OnAshStarted() {
106 DCHECK(thread_checker_.CalledOnValidThread()); 110 DCHECK(thread_checker_.CalledOnValidThread());
107 // We might come here multiple times. As such we should only do this once. 111 // We might come here multiple times. As such we should only do this once.
108 if (on_ash_started_called_) 112 if (on_ash_started_called_)
109 return; 113 return;
110 114
111 on_ash_started_called_ = true; 115 on_ash_started_called_ = true;
112 AddService( 116 AddService(
113 base::WrapUnique(new ArcWindowManagerBridge(arc_bridge_service()))); 117 base::WrapUnique(new ArcWindowManagerBridge(arc_bridge_service())));
114 } 118 }
115 119
116 void ArcServiceManager::Shutdown() { 120 void ArcServiceManager::Shutdown() {
117 icon_loader_ = nullptr; 121 icon_loader_ = nullptr;
118 activity_resolver_ = nullptr; 122 activity_resolver_ = nullptr;
123 arc_user_data_service_ = nullptr;
119 services_.clear(); 124 services_.clear();
120 } 125 }
121 126
122 //static 127 //static
123 void ArcServiceManager::SetArcBridgeServiceForTesting( 128 void ArcServiceManager::SetArcBridgeServiceForTesting(
124 std::unique_ptr<ArcBridgeService> arc_bridge_service) { 129 std::unique_ptr<ArcBridgeService> arc_bridge_service) {
125 if (g_arc_bridge_service_for_testing) { 130 if (g_arc_bridge_service_for_testing) {
126 delete g_arc_bridge_service_for_testing; 131 delete g_arc_bridge_service_for_testing;
127 } 132 }
128 g_arc_bridge_service_for_testing = arc_bridge_service.release(); 133 g_arc_bridge_service_for_testing = arc_bridge_service.release();
129 } 134 }
130 135
131 } // namespace arc 136 } // 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