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

Unified Diff: components/arc/arc_service_manager.cc

Issue 1966133002: Run RemoveArcData after a user has opted out (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: components/arc/arc_service_manager.cc
diff --git a/components/arc/arc_service_manager.cc b/components/arc/arc_service_manager.cc
index 4ef712209f85b98ce047c6ca595e99323cc16f54..43b1826cc19946a89630e7fa08c8bcb585d9db72 100644
--- a/components/arc/arc_service_manager.cc
+++ b/components/arc/arc_service_manager.cc
@@ -22,7 +22,9 @@
#include "components/arc/obb_mounter/arc_obb_mounter_bridge.h"
#include "components/arc/power/arc_power_bridge.h"
#include "components/arc/storage_manager/arc_storage_manager.h"
+#include "components/arc/user_data/arc_user_data_service.h"
#include "components/arc/window_manager/arc_window_manager_bridge.h"
+#include "components/prefs/pref_member.h"
#include "ui/arc/notification/arc_notification_manager.h"
namespace arc {
@@ -65,6 +67,9 @@ ArcServiceManager::ArcServiceManager(
AddService(base::WrapUnique(new ArcObbMounterBridge(arc_bridge_service())));
AddService(base::WrapUnique(new ArcPowerBridge(arc_bridge_service())));
AddService(base::WrapUnique(new ArcStorageManager(arc_bridge_service())));
+
+ arc_user_data_service_ = new ArcUserDataService(this, arc_bridge_service());
hidehiko 2016/06/14 02:05:15 Can we move the instance creation into OnPrimaryUs
dspaid 2016/06/14 04:34:59 Done.
+ AddService(base::WrapUnique(arc_user_data_service_));
}
ArcServiceManager::~ArcServiceManager() {
@@ -95,13 +100,20 @@ void ArcServiceManager::AddService(std::unique_ptr<ArcService> service) {
}
void ArcServiceManager::OnPrimaryUserProfilePrepared(
- const AccountId& account_id) {
+ const AccountId& account_id,
+ std::unique_ptr<BooleanPrefMember> arc_enabled_pref) {
DCHECK(thread_checker_.CalledOnValidThread());
-
+ arc_enabled_pref_ = std::move(arc_enabled_pref);
hidehiko 2016/06/14 02:05:15 Could you pass the instance to the ArcUserDataServ
dspaid 2016/06/14 04:34:59 Done.
+ arc_user_data_service_->OnPrimaryUserProfilePrepared(account_id);
AddService(base::WrapUnique(
new ArcNotificationManager(arc_bridge_service(), account_id)));
}
+bool ArcServiceManager::IsArcEnabled() const {
+ DCHECK(thread_checker_.CalledOnValidThread());
+ return arc_enabled_pref_ && arc_enabled_pref_->GetValue();
+}
+
void ArcServiceManager::OnAshStarted() {
DCHECK(thread_checker_.CalledOnValidThread());
// We might come here multiple times. As such we should only do this once.
@@ -116,6 +128,7 @@ void ArcServiceManager::OnAshStarted() {
void ArcServiceManager::Shutdown() {
icon_loader_ = nullptr;
services_.clear();
+ arc_enabled_pref_.reset();
}
//static

Powered by Google App Engine
This is Rietveld 408576698