Commit af917e1f authored by Li Lin's avatar Li Lin Committed by Commit Bot

Update parent access code validation strings to provide more context.

This CL update the strings for reauth and add user. Follow up CLs will
update the strings for other use cases.

Bug: 921142
Test: unit tests
Change-Id: Ib6c1daa363bdd6e901e1f5842bd274c4b6d85e71
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2347003
Commit-Queue: Li Lin <llin@chromium.org>
Reviewed-by: default avatarAga Wronska <agawronska@chromium.org>
Reviewed-by: default avatarRoman Sorokin [CET] <rsorokin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#799327}
parent bda6ab41
......@@ -2153,12 +2153,21 @@ This file contains the strings for ash.
<message name="IDS_ASH_LOGIN_PARENT_ACCESS_TITLE_ERROR" desc="Title of the parent access input dialog after incorrect code was entered.">
Incorrect parent code
</message>
<message name="IDS_ASH_LOGIN_PARENT_ACCESS_GENERIC_TITLE" desc="Title of the parent access input dialog that allows to add user or reauthenticate with a code.">
Enter parent code
</message>
<message name="IDS_ASH_LOGIN_PARENT_ACCESS_DESCRIPTION" desc="Description shown on the parent access input dialog. Explains what code should be used to unlock the device.">
To unlock the device, enter your Family Link parent access code
</message>
<message name="IDS_ASH_LOGIN_PARENT_ACCESS_GENERIC_DESCRIPTION" desc="Description shown on the parent access input dialog. Explains what code should be used to unlock the device.">
Enter Family Link parent access code.
</message>
<message name="IDS_ASH_LOGIN_PARENT_ACCESS_DESCRIPTION_ADD_USER" desc="Title of the parent access input dialog that allows to add user with a code.">
To add a person, enter your Family Link parent access code
</message>
<message name="IDS_ASH_LOGIN_PARENT_ACCESS_DESCRIPTION_REAUTH" desc="Title of the parent access input dialog that allows to reauthenticate with a code.">
To sign in, enter your Family Link parent access code
</message>
<message name="IDS_ASH_LOGIN_PIN_REQUEST_HELP" desc="Label of a button shown on the pin request input dialog.">
Need help?
</message>
......
e9d67a4c3811e78cdd5bf8ce8d9f42b8ddf35f75
\ No newline at end of file
5c7a1fba7785c298b96d705f71b494e098ba4234
\ No newline at end of file
5c7a1fba7785c298b96d705f71b494e098ba4234
\ No newline at end of file
......@@ -23,7 +23,6 @@ constexpr int kParentAccessCodePinLength = 6;
base::string16 GetTitle(ParentAccessRequestReason reason) {
int title_id;
switch (reason) {
case ParentAccessRequestReason::kOnlineLogin:
case ParentAccessRequestReason::kUnlockTimeLimits:
title_id = IDS_ASH_LOGIN_PARENT_ACCESS_TITLE;
break;
......@@ -33,6 +32,10 @@ base::string16 GetTitle(ParentAccessRequestReason reason) {
case ParentAccessRequestReason::kChangeTimezone:
title_id = IDS_ASH_LOGIN_PARENT_ACCESS_TITLE_CHANGE_TIMEZONE;
break;
case ParentAccessRequestReason::kAddUser:
case ParentAccessRequestReason::kReauth:
title_id = IDS_ASH_LOGIN_PARENT_ACCESS_GENERIC_TITLE;
break;
}
return l10n_util::GetStringUTF16(title_id);
}
......@@ -40,7 +43,6 @@ base::string16 GetTitle(ParentAccessRequestReason reason) {
base::string16 GetDescription(ParentAccessRequestReason reason) {
int description_id;
switch (reason) {
case ParentAccessRequestReason::kOnlineLogin:
case ParentAccessRequestReason::kUnlockTimeLimits:
description_id = IDS_ASH_LOGIN_PARENT_ACCESS_DESCRIPTION;
break;
......@@ -48,6 +50,12 @@ base::string16 GetDescription(ParentAccessRequestReason reason) {
case ParentAccessRequestReason::kChangeTimezone:
description_id = IDS_ASH_LOGIN_PARENT_ACCESS_GENERIC_DESCRIPTION;
break;
case ParentAccessRequestReason::kAddUser:
description_id = IDS_ASH_LOGIN_PARENT_ACCESS_DESCRIPTION_ADD_USER;
break;
case ParentAccessRequestReason::kReauth:
description_id = IDS_ASH_LOGIN_PARENT_ACCESS_DESCRIPTION_REAUTH;
break;
}
return l10n_util::GetStringUTF16(description_id);
}
......@@ -76,13 +84,6 @@ void RecordParentAccessAction(ParentAccessController::UMAAction action) {
void RecordParentAccessUsage(const AccountId& child_account_id,
ParentAccessRequestReason reason) {
switch (reason) {
case ParentAccessRequestReason::kOnlineLogin:
UMA_HISTOGRAM_ENUMERATION(
ParentAccessController::kUMAParentAccessCodeUsage,
child_account_id.empty()
? ParentAccessController::UMAUsage::kAddUserLoginScreen
: ParentAccessController::UMAUsage::kReauhLoginScreen);
return;
case ParentAccessRequestReason::kUnlockTimeLimits: {
UMA_HISTOGRAM_ENUMERATION(
ParentAccessController::kUMAParentAccessCodeUsage,
......@@ -104,6 +105,16 @@ void RecordParentAccessUsage(const AccountId& child_account_id,
ParentAccessController::UMAUsage::kTimezoneChange);
return;
}
case ParentAccessRequestReason::kAddUser:
UMA_HISTOGRAM_ENUMERATION(
ParentAccessController::kUMAParentAccessCodeUsage,
ParentAccessController::UMAUsage::kAddUserLoginScreen);
return;
case ParentAccessRequestReason::kReauth:
UMA_HISTOGRAM_ENUMERATION(
ParentAccessController::kUMAParentAccessCodeUsage,
ParentAccessController::UMAUsage::kReauhLoginScreen);
return;
}
NOTREACHED() << "Unknown ParentAccessRequestReason";
}
......
......@@ -189,7 +189,7 @@ TEST_F(ParentAccessControllerTest, ParentAccessUMARecording) {
GetSessionControllerClient()->SetSessionState(
session_manager::SessionState::LOGIN_PRIMARY);
StartParentAccess(ParentAccessRequestReason::kOnlineLogin);
StartParentAccess(ParentAccessRequestReason::kReauth);
histogram_tester_.ExpectBucketCount(
ParentAccessController::kUMAParentAccessCodeUsage,
ParentAccessController::UMAUsage::kReauhLoginScreen, 1);
......@@ -199,7 +199,7 @@ TEST_F(ParentAccessControllerTest, ParentAccessUMARecording) {
GetSessionControllerClient()->SetSessionState(
session_manager::SessionState::LOGIN_PRIMARY);
StartParentAccess(EmptyAccountId(), ParentAccessRequestReason::kOnlineLogin);
StartParentAccess(EmptyAccountId(), ParentAccessRequestReason::kAddUser);
histogram_tester_.ExpectBucketCount(
ParentAccessController::kUMAParentAccessCodeUsage,
ParentAccessController::UMAUsage::kAddUserLoginScreen, 1);
......
......@@ -341,8 +341,10 @@ enum class ParentAccessRequestReason {
kChangeTime,
// Update values on the timezone settings page.
kChangeTimezone,
// Online login flow.
kOnlineLogin,
// Add user flow.
kAddUser,
// Re-authentication flow.
kReauth,
};
// Parameters and callbacks for a security token PIN request that is to be shown
......
......@@ -166,8 +166,9 @@ void LoginScreenClient::ShowGaiaSignin(const AccountId& prefilled_account) {
prefilled_account,
base::BindOnce(&LoginScreenClient::OnParentAccessValidation,
weak_ptr_factory_.GetWeakPtr(), prefilled_account),
ash::ParentAccessRequestReason::kOnlineLogin, false /* extra_dimmer */,
base::Time::Now());
prefilled_account.empty() ? ash::ParentAccessRequestReason::kAddUser
: ash::ParentAccessRequestReason::kReauth,
false /* extra_dimmer */, base::Time::Now());
} else {
ShowGaiaSigninInternal(prefilled_account);
}
......
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