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

Unified Diff: chrome/browser/chromeos/login/wizard_controller.cc

Issue 696263003: Prevent login while cros settings are untrusted (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@f_2_425574_add_protos_for_device_disabling_in_steady_state
Patch Set: Fix multi-login. Fix style guide violation: no else after return. Created 6 years, 1 month 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/chromeos/login/wizard_controller.cc
diff --git a/chrome/browser/chromeos/login/wizard_controller.cc b/chrome/browser/chromeos/login/wizard_controller.cc
index 5f0003199d62b6602fd761078d741e2285c74741..985931affc827fc006d913e821e9d034b27493fa 100644
--- a/chrome/browser/chromeos/login/wizard_controller.cc
+++ b/chrome/browser/chromeos/login/wizard_controller.cc
@@ -70,6 +70,7 @@
#include "chromeos/network/network_state_handler.h"
#include "chromeos/network/portal_detector/network_portal_detector.h"
#include "chromeos/settings/cros_settings_names.h"
+#include "chromeos/settings/cros_settings_provider.h"
#include "chromeos/settings/timezone_settings.h"
#include "components/crash/app/breakpad_linux.h"
#include "components/pairing/bluetooth_controller_pairing_controller.h"
@@ -1089,6 +1090,24 @@ void WizardController::AutoLaunchKioskApp() {
std::string app_id = KioskAppManager::Get()->GetAutoLaunchApp();
CHECK(KioskAppManager::Get()->GetApp(app_id, &app_data));
+ // Wait for the |CrosSettings| to become either trusted or permanently
+ // untrusted.
+ const CrosSettingsProvider::TrustedStatus status =
+ CrosSettings::Get()->PrepareTrustedValues(base::Bind(
+ &WizardController::AutoLaunchKioskApp,
+ weak_factory_.GetWeakPtr()));
+ if (status == CrosSettingsProvider::TEMPORARILY_UNTRUSTED)
+ return;
+
+ if (status == CrosSettingsProvider::PERMANENTLY_UNTRUSTED) {
+ // If the |cros_settings_| are permanently untrusted, show an error message
+ // and refuse to auto-launch the kiosk app.
+ GetErrorScreen()->SetUIState(ErrorScreen::UI_STATE_LOCAL_STATE_ERROR);
+ SetStatusAreaVisible(false);
+ ShowErrorScreen();
+ return;
+ }
+
host_->StartAppLaunch(app_id, false /* diagnostic_mode */);
}
« no previous file with comments | « chrome/browser/chromeos/login/kiosk_browsertest.cc ('k') | chrome/browser/chromeos/policy/device_local_account_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698