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

Unified Diff: chrome/browser/chromeos/app_mode/arc/arc_kiosk_app_service.cc

Issue 2584813002: arc: Launch Kiosk app immediately after installation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Populate app_id always when preconditions change. Created 4 years 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/app_mode/arc/arc_kiosk_app_service.cc
diff --git a/chrome/browser/chromeos/app_mode/arc/arc_kiosk_app_service.cc b/chrome/browser/chromeos/app_mode/arc/arc_kiosk_app_service.cc
index 59611d3a2168dbcf5912664563ae7871cebb865c..3e54f436ce08f75489b8ed750b4eb85ced66871b 100644
--- a/chrome/browser/chromeos/app_mode/arc/arc_kiosk_app_service.cc
+++ b/chrome/browser/chromeos/app_mode/arc/arc_kiosk_app_service.cc
@@ -28,23 +28,19 @@ ArcKioskAppService* ArcKioskAppService::Get(content::BrowserContext* context) {
void ArcKioskAppService::OnAppRegistered(
const std::string& app_id,
const ArcAppListPrefs::AppInfo& app_info) {
- if (app_id == app_id_)
- PreconditionsChanged();
+ PreconditionsChanged();
}
void ArcKioskAppService::OnAppReadyChanged(const std::string& id, bool ready) {
- if (id == app_id_)
- PreconditionsChanged();
+ PreconditionsChanged();
}
void ArcKioskAppService::OnPackageListInitialRefreshed() {
// The app could already be registered.
- app_id_ = GetAppId();
PreconditionsChanged();
}
void ArcKioskAppService::OnArcKioskAppsChanged() {
- app_id_ = GetAppId();
PreconditionsChanged();
}
@@ -73,7 +69,6 @@ ArcKioskAppService::ArcKioskAppService(Profile* profile, ArcAppListPrefs* prefs)
app_manager_ = ArcKioskAppManager::Get();
if (app_manager_) {
app_manager_->AddObserver(this);
- app_id_ = GetAppId();
}
pref_change_registrar_.reset(new PrefChangeRegistrar());
pref_change_registrar_->Init(profile_->GetPrefs());
@@ -93,6 +88,9 @@ ArcKioskAppService::~ArcKioskAppService() {
}
void ArcKioskAppService::PreconditionsChanged() {
+ app_id_ = GetAppId();
Nikita (slow) 2016/12/19 16:48:18 nit: doesn't look you still need app_id_.
+ if (app_id_.empty())
+ return;
app_info_ = prefs_->GetApp(app_id_);
if (app_info_ && app_info_->ready &&
profile_->GetPrefs()->GetBoolean(prefs::kArcPolicyCompliant)) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698