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

Unified Diff: chrome/browser/ui/app_list/arc/arc_app_list_prefs.cc

Issue 2507073002: Split ArcSessionManager from ArcAuthService. (Closed)
Patch Set: Split ArcSessionManager from ArcAuthService Created 4 years, 1 month 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: chrome/browser/ui/app_list/arc/arc_app_list_prefs.cc
diff --git a/chrome/browser/ui/app_list/arc/arc_app_list_prefs.cc b/chrome/browser/ui/app_list/arc/arc_app_list_prefs.cc
index 1317d0921e9d8d00628170b1ba5b88ad52db1903..d41a350aa049ac0ba5cd67f7fcf9c8a8a2e83968 100644
--- a/chrome/browser/ui/app_list/arc/arc_app_list_prefs.cc
+++ b/chrome/browser/ui/app_list/arc/arc_app_list_prefs.cc
@@ -141,10 +141,11 @@ void DeleteAppFolderFromFileThread(const base::FilePath& path) {
}
bool IsArcEnabled() {
- arc::ArcAuthService* auth_service = arc::ArcAuthService::Get();
- return auth_service &&
- auth_service->state() != arc::ArcAuthService::State::NOT_INITIALIZED &&
- auth_service->IsArcEnabled();
+ arc::ArcSessionManager* arc_session_manager = arc::ArcSessionManager::Get();
+ return arc_session_manager &&
+ arc_session_manager->state() !=
+ arc::ArcSessionManager::State::NOT_INITIALIZED &&
+ arc_session_manager->IsArcEnabled();
}
bool GetInt64FromPref(const base::DictionaryValue* dict,
@@ -240,11 +241,11 @@ ArcAppListPrefs::ArcAppListPrefs(
const base::FilePath& base_path = profile->GetPath();
base_path_ = base_path.AppendASCII(prefs::kArcApps);
- arc::ArcAuthService* auth_service = arc::ArcAuthService::Get();
- if (!auth_service)
+ arc::ArcSessionManager* arc_session_manager = arc::ArcSessionManager::Get();
+ if (!arc_session_manager)
return;
- DCHECK(arc::ArcAuthService::IsAllowedForProfile(profile));
+ DCHECK(arc::ArcSessionManager::IsAllowedForProfile(profile));
// Once default apps are ready OnDefaultAppsReady is called.
}
@@ -257,18 +258,19 @@ ArcAppListPrefs::~ArcAppListPrefs() {
if (bridge_service)
app_instance_holder_->RemoveObserver(this);
- arc::ArcAuthService* auth_service = arc::ArcAuthService::Get();
- if (auth_service)
- auth_service->RemoveObserver(this);
+ arc::ArcSessionManager* arc_session_manager = arc::ArcSessionManager::Get();
+ if (arc_session_manager)
+ arc_session_manager->RemoveObserver(this);
}
void ArcAppListPrefs::StartPrefs() {
- arc::ArcAuthService* auth_service = arc::ArcAuthService::Get();
- CHECK(auth_service);
+ arc::ArcSessionManager* arc_session_manager = arc::ArcSessionManager::Get();
+ CHECK(arc_session_manager);
- if (auth_service->state() != arc::ArcAuthService::State::NOT_INITIALIZED)
- OnOptInEnabled(auth_service->IsArcEnabled());
- auth_service->AddObserver(this);
+ if (arc_session_manager->state() !=
+ arc::ArcSessionManager::State::NOT_INITIALIZED)
+ OnOptInEnabled(arc_session_manager->IsArcEnabled());
+ arc_session_manager->AddObserver(this);
app_instance_holder_->AddObserver(this);
if (!app_instance_holder_->has_instance())

Powered by Google App Engine
This is Rietveld 408576698