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

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

Issue 2707133006: Start ARC and sign in after Chrome OS login (Closed)
Patch Set: Created 3 years, 10 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: 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 017ecaa23967ecdede358b9d5744db36615be9a9..b244d98b35fb9dff0a6ae270a9ff265aac79020d 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,7 +141,13 @@ void DeleteAppFolderFromFileThread(const base::FilePath& path) {
DCHECK(deleted);
}
+bool IsPersistentArc() {
+ return arc::ArcSessionManager::Get()->IsPersistentArc();
+}
+
bool IsArcEnabled() {
+ if (IsPersistentArc())
+ return true;
const auto* arc_session_manager = arc::ArcSessionManager::Get();
return arc_session_manager && arc_session_manager->IsArcPlayStoreEnabled();
}
@@ -417,7 +423,7 @@ std::unique_ptr<ArcAppListPrefs::PackageInfo> ArcAppListPrefs::GetPackage(
}
std::vector<std::string> ArcAppListPrefs::GetAppIds() const {
- if (!IsArcEnabled()) {
+ if (!IsPersistentArc() && !IsArcEnabled()) {
// Default ARC apps available before OptIn.
std::vector<std::string> ids;
for (const auto& default_app : default_apps_.app_map()) {
@@ -431,7 +437,6 @@ std::vector<std::string> ArcAppListPrefs::GetAppIds() const {
std::vector<std::string> ArcAppListPrefs::GetAppIdsNoArcEnabledCheck() const {
std::vector<std::string> ids;
-
const base::DictionaryValue* apps = prefs_->GetDictionary(prefs::kArcApps);
DCHECK(apps);
@@ -595,7 +600,9 @@ void ArcAppListPrefs::RemoveAllApps() {
void ArcAppListPrefs::OnArcPlayStoreEnabledChanged(bool enabled) {
UpdateDefaultAppsHiddenState();
- if (enabled)
+ // TODO(victorhsieh): refactor the logic. For Persistent ARC, we need to
+ // collect apps whether or not the user is opted in to Play.
+ if (enabled || IsPersistentArc())
NotifyRegisteredApps();
else
RemoveAllApps();

Powered by Google App Engine
This is Rietveld 408576698