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

Unified Diff: chrome/browser/chromeos/login/enrollment/auto_enrollment_controller.cc

Issue 871013004: Don't do auto-enrollment if the write protect switch is off. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@gperftools_prof_timer
Patch Set: Fix mistake in test adjustment. Created 5 years, 11 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/policy/device_status_collector.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/login/enrollment/auto_enrollment_controller.cc
diff --git a/chrome/browser/chromeos/login/enrollment/auto_enrollment_controller.cc b/chrome/browser/chromeos/login/enrollment/auto_enrollment_controller.cc
index ad3dc0c4a561ad54e8a32786ef62f09804922778..f028b46d55f910bcda7f123b54c3f979c01f2270 100644
--- a/chrome/browser/chromeos/login/enrollment/auto_enrollment_controller.cc
+++ b/chrome/browser/chromeos/login/enrollment/auto_enrollment_controller.cc
@@ -86,7 +86,16 @@ AutoEnrollmentController::Mode AutoEnrollmentController::GetMode() {
system::StatisticsProvider::GetInstance()->GetMachineStatistic(
system::kFirmwareTypeKey, &firmware_type) &&
firmware_type == system::kFirmwareTypeValueNonchrome;
- return non_chrome_firmware ? MODE_NONE : MODE_FORCED_RE_ENROLLMENT;
+
+ std::string write_protect_switch_boot;
bartfab (slow) 2015/01/26 15:48:55 Nit: Maybe s/boot/on_boot/? The name does not make
Mattias Nissler (ping if slow) 2015/01/26 20:08:50 This name is consistent with system::kWriteProtect
+ const bool write_protect_switch_off =
+ system::StatisticsProvider::GetInstance()->GetMachineStatistic(
+ system::kWriteProtectSwitchBootKey, &write_protect_switch_boot) &&
+ write_protect_switch_boot == system::kWriteProtectSwitchBootValueOff;
+
+ return (non_chrome_firmware || write_protect_switch_off)
+ ? MODE_NONE
+ : MODE_FORCED_RE_ENROLLMENT;
#else
return MODE_NONE;
#endif
« no previous file with comments | « no previous file | chrome/browser/chromeos/policy/device_status_collector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698