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 b9435042b0381fb415e516b1c315eb791a2f66f0..7ee6dab99b2873ca887f5249fca6e9f1038f9a7c 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 |
@@ -15,13 +15,12 @@ |
namespace chromeos { |
// static |
-ArcKioskAppService* ArcKioskAppService::Create(Profile* profile, |
- ArcAppListPrefs* prefs) { |
- return new ArcKioskAppService(profile, prefs); |
+ArcKioskAppService* ArcKioskAppService::Create(Profile* profile) { |
+ return new ArcKioskAppService(profile); |
} |
// static |
-ArcKioskAppService* ArcKioskAppService::Get(content::BrowserContext* context) { |
+ArcKioskAppService* ArcKioskAppService::Get(Profile* context) { |
Luis Héctor Chávez
2016/12/01 20:13:33
This doesn't need to change. Profile is-a content:
Sergey Poromov
2016/12/16 16:12:05
Done.
|
return ArcKioskAppServiceFactory::GetForBrowserContext(context); |
} |
@@ -65,8 +64,20 @@ void ArcKioskAppService::OnTaskDestroyed(int32_t task_id) { |
} |
} |
-ArcKioskAppService::ArcKioskAppService(Profile* profile, ArcAppListPrefs* prefs) |
- : profile_(profile), prefs_(prefs) { |
+void ArcKioskAppService::OnMaintenanceSessionCreated() { |
+ maintenance_session_running_ = true; |
+ PreconditionsChanged(); |
+} |
+ |
+void ArcKioskAppService::OnMaintenanceSessionFinished() { |
+ maintenance_session_running_ = false; |
+ PreconditionsChanged(); |
+} |
+ |
+ArcKioskAppService::ArcKioskAppService(Profile* profile) |
+ : profile_(profile), |
+ prefs_(ArcAppListPrefs::Get(profile)), |
Luis Héctor Chávez
2016/12/01 20:13:33
Remove this line and then s/prefs_/ArcAppListPrefs
Sergey Poromov
2016/12/16 16:12:05
Done.
|
+ maintenance_session_running_(false) { |
if (prefs_) |
prefs_->AddObserver(this); |
app_manager_ = ArcKioskAppManager::Get(); |
@@ -94,7 +105,8 @@ ArcKioskAppService::~ArcKioskAppService() { |
void ArcKioskAppService::PreconditionsChanged() { |
app_info_ = prefs_->GetApp(app_id_); |
if (app_info_ && app_info_->ready && |
- profile_->GetPrefs()->GetBoolean(prefs::kArcPolicyCompliant)) { |
+ profile_->GetPrefs()->GetBoolean(prefs::kArcPolicyCompliant) && |
+ !maintenance_session_running_) { |
if (!app_launcher_) |
app_launcher_.reset(new ArcKioskAppLauncher(profile_, prefs_, app_id_)); |
} else if (task_id_ != -1) { |