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

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: Wait for compliance report to start ARC Kiosk app. 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') | chrome/common/pref_names.cc » ('J')
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 71f17812231d3d24d3078f2a362365c8462e4941..fd2c314b3c3e6573dac2b2d6d09f3b0d448763bc 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
@@ -155,6 +155,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();
}
@@ -185,9 +190,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') | chrome/common/pref_names.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698