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

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: test coverage in chrome_launcher_controller_impl_unittest.cc 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..335f3cadcb1c50eb4c7a11323af6867fa87fc35a 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
@@ -23,6 +23,7 @@
#include "chrome/common/pref_names.h"
#include "chrome/grit/generated_resources.h"
#include "components/arc/arc_service_manager.h"
+#include "components/arc/arc_util.h"
#include "components/crx_file/id_util.h"
#include "components/pref_registry/pref_registry_syncable.h"
#include "components/prefs/scoped_user_pref_update.h"
@@ -142,6 +143,8 @@ void DeleteAppFolderFromFileThread(const base::FilePath& path) {
}
bool IsArcEnabled() {
+ if (arc::ShouldAlwaysStartArc())
+ return true;
const auto* arc_session_manager = arc::ArcSessionManager::Get();
return arc_session_manager && arc_session_manager->IsArcPlayStoreEnabled();
}
@@ -294,6 +297,14 @@ base::FilePath ArcAppListPrefs::GetIconPath(
void ArcAppListPrefs::RequestIcon(const std::string& app_id,
ui::ScaleFactor scale_factor) {
+#if defined(UNIT_TEST)
+ // FIXME: what's the best way/place to detect and cancel this?
victorhsieh 2017/02/25 00:21:33 Please advise.
hidehiko 2017/02/28 19:26:06 Could you share which test is problematic and its
victorhsieh 2017/02/28 21:47:06 ChromeLauncherControllerImplWithArcTest.ArcAppPin/
hidehiko 2017/03/02 15:57:51 Great to know. Thank you for explanation. My two
victorhsieh 2017/03/02 18:49:52 Acknowledged.
+ // ArcSessionManager can be terminated during test tear down, before callback
+ // into this function.
+ if (arc::ArcSessionManager::Get() == nullptr)
+ return;
+#endif
+
if (!IsRegistered(app_id)) {
VLOG(2) << "Request to load icon for non-registered app: " << app_id << ".";
return;
@@ -417,7 +428,7 @@ std::unique_ptr<ArcAppListPrefs::PackageInfo> ArcAppListPrefs::GetPackage(
}
std::vector<std::string> ArcAppListPrefs::GetAppIds() const {
- if (!IsArcEnabled()) {
+ if (!arc::ShouldAlwaysStartArc() && !IsArcEnabled()) {
// Default ARC apps available before OptIn.
std::vector<std::string> ids;
for (const auto& default_app : default_apps_.app_map()) {
@@ -431,7 +442,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 +605,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 || arc::ShouldAlwaysStartArc())
khmel 2017/02/28 00:10:10 Top level comment and thoughts. I think that is m
victorhsieh 2017/02/28 18:57:33 Yes, that's also my plan, too. This CL should pre
khmel 2017/02/28 21:58:44 Even system apps?
victorhsieh 2017/02/28 23:43:16 Yes. But the plan is still TBD at the moment.
NotifyRegisteredApps();
else
RemoveAllApps();

Powered by Google App Engine
This is Rietveld 408576698