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

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

Issue 2809773004: Wait for compliance report to start ARC Kiosk app. (Closed)
Patch Set: small comment update Created 3 years, 8 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
« no previous file with comments | « no previous file | chrome/browser/chromeos/arc/policy/arc_policy_bridge.h » ('j') | 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 d505ec21f8a885f6d8f51270467b1f84b6337561..e91bc828b5c1f1e51a8cf6cb6ae5c4884ed8ce79 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
@@ -141,6 +141,11 @@ ArcKioskAppService::ArcKioskAppService(Profile* profile) : profile_(profile) {
app_manager_->AddObserver(this);
pref_change_registrar_.reset(new PrefChangeRegistrar());
pref_change_registrar_->Init(profile_->GetPrefs());
+ // Kiosk app can be started only when policy compliance is reported.
+ pref_change_registrar_->Add(
+ prefs::kArcPolicyComplianceReported,
+ base::Bind(&ArcKioskAppService::PreconditionsChanged,
+ base::Unretained(this)));
notification_blocker_.reset(new ArcKioskNotificationBlocker());
PreconditionsChanged();
}
@@ -160,9 +165,15 @@ void ArcKioskAppService::PreconditionsChanged() {
VLOG_IF(2, app_info_ && app_info_->ready) << "Kiosk app is ready";
VLOG(2) << "Maintenance session is "
<< (maintenance_session_running_ ? "running" : "not running");
+ VLOG(2) << "Policy compliance is "
+ << (profile_->GetPrefs()->GetBoolean(
+ prefs::kArcPolicyComplianceReported)
+ ? "reported"
+ : "not yet reported");
VLOG(2) << "Kiosk app with id: " << app_id_ << " is "
<< (app_launcher_ ? "already launched" : "not yet launched");
- if (app_info_ && app_info_->ready && !maintenance_session_running_) {
+ if (app_info_ && app_info_->ready && !maintenance_session_running_ &&
+ profile_->GetPrefs()->GetBoolean(prefs::kArcPolicyComplianceReported)) {
if (!app_launcher_) {
VLOG(2) << "Starting kiosk app";
app_launcher_ = base::MakeUnique<ArcKioskAppLauncher>(
« no previous file with comments | « no previous file | chrome/browser/chromeos/arc/policy/arc_policy_bridge.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698