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(); |