Commit 99a27f95 authored by Renato Silva's avatar Renato Silva Committed by Commit Bot

Improve variable name - Chrome OS OOBE

Changes the name of a variable used in the enterprise enrollment
screen in OOBE. 'last_auth_' was replaced with 'next_auth_'. The
author intention with 'last_auth_' was probably 'last_auth_to_try_'.
'next_auth_' makes it easier to understand the code's logic.

Change-Id: If1b8ffbfc17767b5a4a4f725856522338231f32b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1939805
Auto-Submit: Renato Silva <rrsilva@google.com>
Reviewed-by: default avatarYves Arrouye <drcrash@chromium.org>
Reviewed-by: default avatarRoman Sorokin [CET] <rsorokin@chromium.org>
Commit-Queue: Roman Sorokin [CET] <rsorokin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#737261}
parent d455934d
...@@ -135,15 +135,15 @@ void EnrollmentScreen::SetEnrollmentConfig( ...@@ -135,15 +135,15 @@ void EnrollmentScreen::SetEnrollmentConfig(
switch (enrollment_config_.auth_mechanism) { switch (enrollment_config_.auth_mechanism) {
case EnrollmentConfig::AUTH_MECHANISM_INTERACTIVE: case EnrollmentConfig::AUTH_MECHANISM_INTERACTIVE:
current_auth_ = AUTH_OAUTH; current_auth_ = AUTH_OAUTH;
last_auth_ = AUTH_OAUTH; next_auth_ = AUTH_OAUTH;
break; break;
case EnrollmentConfig::AUTH_MECHANISM_ATTESTATION: case EnrollmentConfig::AUTH_MECHANISM_ATTESTATION:
current_auth_ = AUTH_ATTESTATION; current_auth_ = AUTH_ATTESTATION;
last_auth_ = AUTH_ATTESTATION; next_auth_ = AUTH_ATTESTATION;
break; break;
case EnrollmentConfig::AUTH_MECHANISM_BEST_AVAILABLE: case EnrollmentConfig::AUTH_MECHANISM_BEST_AVAILABLE:
current_auth_ = AUTH_ATTESTATION; current_auth_ = AUTH_ATTESTATION;
last_auth_ = enrollment_config_.should_enroll_interactively() next_auth_ = enrollment_config_.should_enroll_interactively()
? AUTH_OAUTH ? AUTH_OAUTH
: AUTH_ATTESTATION; : AUTH_ATTESTATION;
break; break;
...@@ -173,10 +173,10 @@ void EnrollmentScreen::SetConfig() { ...@@ -173,10 +173,10 @@ void EnrollmentScreen::SetConfig() {
} }
bool EnrollmentScreen::AdvanceToNextAuth() { bool EnrollmentScreen::AdvanceToNextAuth() {
if (current_auth_ != last_auth_ && current_auth_ == AUTH_ATTESTATION) { if (current_auth_ != next_auth_ && current_auth_ == AUTH_ATTESTATION) {
LOG(WARNING) << "User stopped using auth: " << current_auth_ LOG(WARNING) << "User stopped using auth: " << current_auth_
<< ", current auth: " << last_auth_ << "."; << ", current auth: " << next_auth_ << ".";
current_auth_ = last_auth_; current_auth_ = next_auth_;
SetConfig(); SetConfig();
return true; return true;
} }
...@@ -518,7 +518,7 @@ void EnrollmentScreen::ShowSigninScreen() { ...@@ -518,7 +518,7 @@ void EnrollmentScreen::ShowSigninScreen() {
void EnrollmentScreen::RecordEnrollmentErrorMetrics() { void EnrollmentScreen::RecordEnrollmentErrorMetrics() {
enrollment_failed_once_ = true; enrollment_failed_once_ = true;
// TODO(crbug.com/896793): Have other metrics for each auth mechanism. // TODO(crbug.com/896793): Have other metrics for each auth mechanism.
if (elapsed_timer_ && current_auth_ == last_auth_) if (elapsed_timer_ && current_auth_ == next_auth_)
UMA_ENROLLMENT_TIME(kMetricEnrollmentTimeFailure, elapsed_timer_); UMA_ENROLLMENT_TIME(kMetricEnrollmentTimeFailure, elapsed_timer_);
} }
......
...@@ -184,8 +184,11 @@ class EnrollmentScreen ...@@ -184,8 +184,11 @@ class EnrollmentScreen
ScreenExitCallback exit_callback_; ScreenExitCallback exit_callback_;
policy::EnrollmentConfig config_; policy::EnrollmentConfig config_;
policy::EnrollmentConfig enrollment_config_; policy::EnrollmentConfig enrollment_config_;
// 'Current' and 'Next' authentication mechanisms to be used.
Auth current_auth_ = AUTH_OAUTH; Auth current_auth_ = AUTH_OAUTH;
Auth last_auth_ = AUTH_OAUTH; Auth next_auth_ = AUTH_OAUTH;
bool enrollment_failed_once_ = false; bool enrollment_failed_once_ = false;
bool enrollment_succeeded_ = false; bool enrollment_succeeded_ = false;
std::string enrolling_user_domain_; std::string enrolling_user_domain_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment