Skip to content

Commit

Permalink
[M111][Signin] Use strings from Signin Intercept bubble V1 in bubble V2
Browse files Browse the repository at this point in the history
Preview: https://crbug.com/1282157#c95

(cherry picked from commit 8cedfac)

Fixed: 1411421
Change-Id: I5050a190b2dd87f145ea61136a8f836ecdb42723
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4200244
Reviewed-by: David Roger <droger@chromium.org>
Commit-Queue: Gabriel Oliveira <gabolvr@google.com>
Cr-Original-Commit-Position: refs/heads/main@{#1098793}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4212528
Commit-Queue: David Roger <droger@chromium.org>
Auto-Submit: Gabriel Oliveira <gabolvr@google.com>
Cr-Commit-Position: refs/branch-heads/5563@{#79}
Cr-Branched-From: 3ac59a6-refs/heads/main@{#1097615}
  • Loading branch information
Gabriel Oliveira authored and Chromium LUCI CQ committed Feb 1, 2023
1 parent f771f42 commit 7b3cb67
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -249,11 +249,6 @@ std::string DiceWebSigninInterceptHandler::GetBodyTitle() {
IDS_SIGNIN_DICE_WEB_INTERCEPT_SWITCH_BUBBLE_TITLE);
}

if (base::FeatureList::IsEnabled(kSigninInterceptBubbleV2)) {
return l10n_util::GetStringUTF8(
IDS_SIGNIN_DICE_WEB_INTERCEPT_CREATE_BUBBLE_TITLE_V2);
}

return l10n_util::GetStringUTF8(
IDS_SIGNIN_DICE_WEB_INTERCEPT_CREATE_BUBBLE_TITLE);
}
Expand All @@ -265,11 +260,6 @@ std::string DiceWebSigninInterceptHandler::GetBodyText() {
IDS_SIGNIN_DICE_WEB_INTERCEPT_SWITCH_BUBBLE_DESC);
}

if (base::FeatureList::IsEnabled(kSigninInterceptBubbleV2)) {
return l10n_util::GetStringUTF8(
IDS_SIGNIN_DICE_WEB_INTERCEPT_CONSUMER_BUBBLE_DESC_V2);
}

switch (bubble_parameters_.interception_type) {
case DiceWebSigninInterceptor::SigninInterceptionType::kEnterprise:
return ShouldShowManagedDeviceVersion()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,11 @@ const ExpectedStringGenerator common_v2_strings_generator =
/*header_text=*/"",
/*body_title=*/
l10n_util::GetStringUTF8(
IDS_SIGNIN_DICE_WEB_INTERCEPT_CREATE_BUBBLE_TITLE_V2),
IDS_SIGNIN_DICE_WEB_INTERCEPT_CREATE_BUBBLE_TITLE),
/*body_text=*/
l10n_util::GetStringUTF8(
IDS_SIGNIN_DICE_WEB_INTERCEPT_CONSUMER_BUBBLE_DESC_V2),
l10n_util::GetStringFUTF8(
IDS_SIGNIN_DICE_WEB_INTERCEPT_CONSUMER_BUBBLE_DESC,
base::UTF8ToUTF16(primary_account.given_name)),
/*confirm_button_label=*/
l10n_util::GetStringUTF8(
IDS_SIGNIN_DICE_WEB_INTERCEPT_BUBBLE_NEW_PROFILE_BUTTON_LABEL),
Expand Down Expand Up @@ -145,7 +146,25 @@ const TestParam kTestParams[] = {
IDS_SIGNIN_DICE_WEB_INTERCEPT_BUBBLE_CANCEL_BUTTON_LABEL),
};
}),
/*expected_strings_v2=*/common_v2_strings_generator,
/*expected_strings_v2=*/base::BindRepeating([] {
return BubbleStrings{
/*header_text=*/"",
/*body_title=*/
l10n_util::GetStringUTF8(
IDS_SIGNIN_DICE_WEB_INTERCEPT_CREATE_BUBBLE_TITLE),
/*body_text=*/
l10n_util::GetStringFUTF8(
IDS_SIGNIN_DICE_WEB_INTERCEPT_CONSUMER_BUBBLE_DESC_MANAGED_DEVICE,
base::UTF8ToUTF16(primary_account.given_name),
base::UTF8ToUTF16(intercepted_account.email)),
/*confirm_button_label=*/
l10n_util::GetStringUTF8(
IDS_SIGNIN_DICE_WEB_INTERCEPT_BUBBLE_NEW_PROFILE_BUTTON_LABEL),
/*cancel_button_label=*/
l10n_util::GetStringUTF8(
IDS_SIGNIN_DICE_WEB_INTERCEPT_BUBBLE_CANCEL_BUTTON_LABEL),
};
}),
},
{
DiceWebSigninInterceptor::SigninInterceptionType::kEnterprise,
Expand All @@ -168,7 +187,24 @@ const TestParam kTestParams[] = {
IDS_SIGNIN_DICE_WEB_INTERCEPT_BUBBLE_CANCEL_BUTTON_LABEL),
};
}),
/*expected_strings_v2=*/common_v2_strings_generator,
/*expected_strings_v2=*/base::BindRepeating([] {
return BubbleStrings{
/*header_text=*/"",
/*body_title=*/
l10n_util::GetStringUTF8(
IDS_SIGNIN_DICE_WEB_INTERCEPT_CREATE_BUBBLE_TITLE),
/*body_text=*/
l10n_util::GetStringFUTF8(
IDS_SIGNIN_DICE_WEB_INTERCEPT_ENTERPRISE_BUBBLE_DESC,
base::UTF8ToUTF16(primary_account.email)),
/*confirm_button_label=*/
l10n_util::GetStringUTF8(
IDS_SIGNIN_DICE_WEB_INTERCEPT_BUBBLE_NEW_PROFILE_BUTTON_LABEL),
/*cancel_button_label=*/
l10n_util::GetStringUTF8(
IDS_SIGNIN_DICE_WEB_INTERCEPT_BUBBLE_CANCEL_BUTTON_LABEL),
};
}),
},
{
DiceWebSigninInterceptor::SigninInterceptionType::kEnterprise,
Expand All @@ -191,7 +227,24 @@ const TestParam kTestParams[] = {
IDS_SIGNIN_DICE_WEB_INTERCEPT_BUBBLE_CANCEL_BUTTON_LABEL),
};
}),
/*expected_strings_v2=*/common_v2_strings_generator,
/*expected_strings_v2=*/base::BindRepeating([] {
return BubbleStrings{
/*header_text=*/"",
/*body_title=*/
l10n_util::GetStringUTF8(
IDS_SIGNIN_DICE_WEB_INTERCEPT_CREATE_BUBBLE_TITLE),
/*body_text=*/
l10n_util::GetStringFUTF8(
IDS_SIGNIN_DICE_WEB_INTERCEPT_ENTERPRISE_BUBBLE_DESC_MANAGED_DEVICE,
base::UTF8ToUTF16(intercepted_account.email)),
/*confirm_button_label=*/
l10n_util::GetStringUTF8(
IDS_SIGNIN_DICE_WEB_INTERCEPT_BUBBLE_NEW_PROFILE_BUTTON_LABEL),
/*cancel_button_label=*/
l10n_util::GetStringUTF8(
IDS_SIGNIN_DICE_WEB_INTERCEPT_BUBBLE_CANCEL_BUTTON_LABEL),
};
}),
},
};

Expand Down

0 comments on commit 7b3cb67

Please sign in to comment.