Skip to content

Commit

Permalink
Revert "[signin] Update strings for signin intercept bubble"
Browse files Browse the repository at this point in the history
This reverts commit 379e3ff.

Reason for revert: crbug.com/1324377

Original change's description:
> [signin] Update strings for signin intercept bubble
>
> The new strings are shown only when the SyncPromoAfterSigninIntercept
> feature is enabled
>
> Bug: 1282157, 1300500
> Change-Id: Id3e05a432a1d3041993e4d9f98f4b72df98a168f
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3412262
> Reviewed-by: Monica Basta <msalama@chromium.org>
> Reviewed-by: Alex Ilin <alexilin@chromium.org>
> Commit-Queue: Nicolas Dossou-Gbété <dgn@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1001489}

Bug: 1282157, 1300500
Change-Id: I75d6157d4d6445370da5fab1110822b4ae1f2500
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3639467
Owners-Override: Mike Wasserman <msw@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Mike Wasserman <msw@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1001786}
  • Loading branch information
Mike Wasserman authored and Chromium LUCI CQ committed May 10, 2022
1 parent 52cfa8b commit a36e0d0
Show file tree
Hide file tree
Showing 13 changed files with 37 additions and 357 deletions.
3 changes: 0 additions & 3 deletions chrome/app/chromium_strings.grd
Original file line number Diff line number Diff line change
Expand Up @@ -896,9 +896,6 @@ Permissions you've already given to websites and apps may apply to this account.
<message name="IDS_SIGNIN_DICE_WEB_INTERCEPT_ENTERPRISE_BUBBLE_DESC_MANAGED_DEVICE" desc="Body of the web signin interception bubble when the new account is personal and the existing account is managed on a managed device">
This will create a new Chromium profile for <ph name="USER_EMAIL_ADDRESS">$1<ex>foo@gmail.com</ex></ph>
</message>
<message name="IDS_SIGNIN_DICE_WEB_INTERCEPT_CONSUMER_BUBBLE_DESC_V2" desc="Body of the web signin interception bubble. It is shown when the user signs in on the web while they already have another account present in the current profile.">
Another account is already signed in. To keep your browsing separate, Chromium can create your own profile for you.
</message>
</if>

<if expr="not chromeos_ash and not is_android">
Expand Down

This file was deleted.

7 changes: 2 additions & 5 deletions chrome/app/generated_resources.grd
Original file line number Diff line number Diff line change
Expand Up @@ -9571,8 +9571,8 @@ Check your passwords anytime in <ph name="GOOGLE_PASSWORD_MANAGER">$1<ex>Google
<message name="IDS_SIGNIN_DICE_WEB_INTERCEPT_BUBBLE_NEW_PROFILE_BUTTON_LABEL" desc="Label of the confirmation button in the web signin interception bubble">
Ok
</message>
<message name="IDS_SIGNIN_DICE_WEB_INTERCEPT_BUBBLE_NEW_PROFILE_BUTTON_LABEL_V2" desc="Label of the confirmation button in the web signin interception bubble. This action will create a new Chrome profile for the intercepted account.">
Let's go
<message name="IDS_SIGNIN_DICE_WEB_INTERCEPT_BUBBLE_NEW_PROFILE_BUTTON_LABEL_V2" desc="Label of the confirmation button in the web signin interception bubble">
Continue
</message>
<message name="IDS_SIGNIN_DICE_WEB_INTERCEPT_BUBBLE_CANCEL_BUTTON_LABEL" desc="Label of the cancel button in the web signin interception bubble">
No thanks
Expand All @@ -9595,9 +9595,6 @@ Check your passwords anytime in <ph name="GOOGLE_PASSWORD_MANAGER">$1<ex>Google
<message name="IDS_SIGNIN_DICE_WEB_INTERCEPT_SWITCH_BUBBLE_DESC_V2" desc="Description for the profile switch interception bubble">
<ph name="NAME">$2<ex>Bob</ex></ph>'s profile is linked to <ph name="EMAIL">$1<ex>bob@gmail.com</ex></ph>
</message>
<message name="IDS_SIGNIN_DICE_WEB_INTERCEPT_CREATE_BUBBLE_TITLE_V2" desc="Title of the web signin interception bubble. 'Separate' is an action verb. The prompt is shown to let the user choose to keep the browsing activity for a new account in the same profile as an existing one or to move it to a new profile.">
Separate your browsing?
</message>
</if>

<if expr="not chromeos_ash and not is_android">
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
fb7880ec02a99b1375ac9ee3cf586d1ea94454a3
fc87331e840b0ff507e4778b3cf5c0e870683270

This file was deleted.

3 changes: 0 additions & 3 deletions chrome/app/google_chrome_strings.grd
Original file line number Diff line number Diff line change
Expand Up @@ -940,9 +940,6 @@ Permissions you've already given to websites and apps may apply to this account.
<message name="IDS_SIGNIN_DICE_WEB_INTERCEPT_ENTERPRISE_BUBBLE_DESC_MANAGED_DEVICE" desc="Body of the web signin interception bubble when the new account is personal and the existing account is managed on a managed device">
This will create a new Chrome profile for <ph name="USER_EMAIL_ADDRESS">$1<ex>foo@gmail.com</ex></ph>
</message>
<message name="IDS_SIGNIN_DICE_WEB_INTERCEPT_CONSUMER_BUBBLE_DESC_V2" desc="Body of the web signin interception bubble. It is shown when the user signs in on the web while they already have another account present in the current profile.">
Another account is already signed in. To keep your browsing separate, Chrome can create your own profile for you.
</message>
</if>

<if expr="not chromeos_ash and not is_android">
Expand Down

This file was deleted.

5 changes: 0 additions & 5 deletions chrome/browser/signin/signin_features.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,3 @@ const base::Feature kProcessGaiaRemoveLocalAccountHeader{
// Enables the sync promo after the sign-in intercept.
const base::Feature kSyncPromoAfterSigninIntercept{
"SyncPromoAfterSigninIntercept", base::FEATURE_DISABLED_BY_DEFAULT};

// Enables using new style (strings, illustration, and disclaimer if needed)
// for the sign-in intercept bubble.
const base::Feature kSigninInterceptBubbleV2{"SigninInterceptBubbleV2",
base::FEATURE_DISABLED_BY_DEFAULT};
2 changes: 0 additions & 2 deletions chrome/browser/signin/signin_features.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,4 @@ extern const base::Feature kProcessGaiaRemoveLocalAccountHeader;

extern const base::Feature kSyncPromoAfterSigninIntercept;

extern const base::Feature kSigninInterceptBubbleV2;

#endif // CHROME_BROWSER_SIGNIN_SIGNIN_FEATURES_H_
98 changes: 34 additions & 64 deletions chrome/browser/ui/webui/signin/dice_web_signin_intercept_handler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -173,12 +173,25 @@ base::Value DiceWebSigninInterceptHandler::GetAccountInfoValue(
}

base::Value DiceWebSigninInterceptHandler::GetInterceptionParametersValue() {
bool is_switch =
bubble_parameters_.interception_type ==
DiceWebSigninInterceptor::SigninInterceptionType::kProfileSwitch;
int confirmButtonStringID =
is_switch
? IDS_SIGNIN_DICE_WEB_INTERCEPT_BUBBLE_CONFIRM_SWITCH_BUTTON_LABEL
: IDS_SIGNIN_DICE_WEB_INTERCEPT_BUBBLE_NEW_PROFILE_BUTTON_LABEL;
int cancelButtonStringID =
is_switch
? IDS_SIGNIN_DICE_WEB_INTERCEPT_BUBBLE_CANCEL_SWITCH_BUTTON_LABEL
: IDS_SIGNIN_DICE_WEB_INTERCEPT_BUBBLE_CANCEL_BUTTON_LABEL;
base::Value parameters(base::Value::Type::DICTIONARY);
parameters.SetStringKey("headerText", GetHeaderText());
parameters.SetStringKey("bodyTitle", GetBodyTitle());
parameters.SetStringKey("bodyText", GetBodyText());
parameters.SetStringKey("confirmButtonLabel", GetConfirmButtonLabel());
parameters.SetStringKey("cancelButtonLabel", GetCancelButtonLabel());
parameters.SetStringKey("confirmButtonLabel",
l10n_util::GetStringUTF8(confirmButtonStringID));
parameters.SetStringKey("cancelButtonLabel",
l10n_util::GetStringUTF8(cancelButtonStringID));
parameters.SetBoolKey("showGuestOption",
bubble_parameters_.show_guest_option);
parameters.SetKey("interceptedAccount",
Expand All @@ -191,7 +204,9 @@ base::Value DiceWebSigninInterceptHandler::GetInterceptionParametersValue() {
"primaryProfileColor",
color_utils::SkColorToRgbaString(
GetProfileHighlightColor(Profile::FromWebUI(web_ui()))));
parameters.SetBoolKey("useV2Design", GetShouldUseV2Design());
parameters.SetBoolKey("useV2Design",
!is_switch && base::FeatureList::IsEnabled(
kSyncPromoAfterSigninIntercept));

parameters.SetStringKey(
"headerTextColor",
Expand All @@ -218,21 +233,21 @@ bool DiceWebSigninInterceptHandler::ShouldShowManagedDeviceVersion() {
}

std::string DiceWebSigninInterceptHandler::GetHeaderText() {
if (bubble_parameters_.interception_type ==
DiceWebSigninInterceptor::SigninInterceptionType::kProfileSwitch) {
return intercepted_account().given_name;
}

if (base::FeatureList::IsEnabled(kSigninInterceptBubbleV2))
return std::string();

if (bubble_parameters_.interception_type ==
DiceWebSigninInterceptor::SigninInterceptionType::kEnterprise &&
IsManaged(intercepted_account())) {
return intercepted_account().hosted_domain;
switch (bubble_parameters_.interception_type) {
case DiceWebSigninInterceptor::SigninInterceptionType::kEnterprise:
return IsManaged(intercepted_account())
? intercepted_account().hosted_domain
: intercepted_account().given_name;
case DiceWebSigninInterceptor::SigninInterceptionType::kMultiUser:
case DiceWebSigninInterceptor::SigninInterceptionType::kProfileSwitch:
return intercepted_account().given_name;
case DiceWebSigninInterceptor::SigninInterceptionType::kEnterpriseForced:
case DiceWebSigninInterceptor::SigninInterceptionType::
kEnterpriseAcceptManagement:
case DiceWebSigninInterceptor::SigninInterceptionType::kProfileSwitchForced:
NOTREACHED() << "This interception type is not handled by a bubble";
return std::string();
}

return intercepted_account().given_name;
}

std::string DiceWebSigninInterceptHandler::GetBodyTitle() {
Expand All @@ -241,28 +256,11 @@ std::string DiceWebSigninInterceptHandler::GetBodyTitle() {
return l10n_util::GetStringUTF8(
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);
}

std::string DiceWebSigninInterceptHandler::GetBodyText() {
if (bubble_parameters_.interception_type ==
DiceWebSigninInterceptor::SigninInterceptionType::kProfileSwitch) {
return l10n_util::GetStringUTF8(
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 All @@ -282,7 +280,8 @@ std::string DiceWebSigninInterceptHandler::GetBodyText() {
IDS_SIGNIN_DICE_WEB_INTERCEPT_CONSUMER_BUBBLE_DESC,
base::UTF8ToUTF16(primary_account().given_name));
case DiceWebSigninInterceptor::SigninInterceptionType::kProfileSwitch:
// Already handled.
return l10n_util::GetStringUTF8(
IDS_SIGNIN_DICE_WEB_INTERCEPT_SWITCH_BUBBLE_DESC);
case DiceWebSigninInterceptor::SigninInterceptionType::
kEnterpriseAcceptManagement:
case DiceWebSigninInterceptor::SigninInterceptionType::kEnterpriseForced:
Expand All @@ -291,32 +290,3 @@ std::string DiceWebSigninInterceptHandler::GetBodyText() {
return std::string();
}
}

std::string DiceWebSigninInterceptHandler::GetConfirmButtonLabel() {
if (bubble_parameters_.interception_type ==
DiceWebSigninInterceptor::SigninInterceptionType::kProfileSwitch) {
return l10n_util::GetStringUTF8(
IDS_SIGNIN_DICE_WEB_INTERCEPT_BUBBLE_CONFIRM_SWITCH_BUTTON_LABEL);
}

return l10n_util::GetStringUTF8(
base::FeatureList::IsEnabled(kSigninInterceptBubbleV2)
? IDS_SIGNIN_DICE_WEB_INTERCEPT_BUBBLE_NEW_PROFILE_BUTTON_LABEL_V2
: IDS_SIGNIN_DICE_WEB_INTERCEPT_BUBBLE_NEW_PROFILE_BUTTON_LABEL);
}

std::string DiceWebSigninInterceptHandler::GetCancelButtonLabel() {
return l10n_util::GetStringUTF8(
bubble_parameters_.interception_type ==
DiceWebSigninInterceptor::SigninInterceptionType::kProfileSwitch
? IDS_SIGNIN_DICE_WEB_INTERCEPT_BUBBLE_CANCEL_SWITCH_BUTTON_LABEL
: IDS_SIGNIN_DICE_WEB_INTERCEPT_BUBBLE_CANCEL_BUTTON_LABEL);
}

bool DiceWebSigninInterceptHandler::GetShouldUseV2Design() {
if (bubble_parameters_.interception_type ==
DiceWebSigninInterceptor::SigninInterceptionType::kProfileSwitch)
return false;

return base::FeatureList::IsEnabled(kSigninInterceptBubbleV2);
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,6 @@ class DiceWebSigninInterceptHandler : public content::WebUIMessageHandler,
void OnExtendedAccountInfoUpdated(const AccountInfo& info) override;

private:
friend class DiceWebSigninInterceptHandlerTest;
FRIEND_TEST_ALL_PREFIXES(DiceWebSigninInterceptHandlerTest,
GetInterceptionParametersValue);

const AccountInfo& primary_account();
const AccountInfo& intercepted_account();

Expand All @@ -62,9 +58,6 @@ class DiceWebSigninInterceptHandler : public content::WebUIMessageHandler,
std::string GetHeaderText();
std::string GetBodyTitle();
std::string GetBodyText();
std::string GetConfirmButtonLabel();
std::string GetCancelButtonLabel();
bool GetShouldUseV2Design();

base::ScopedObservation<signin::IdentityManager,
signin::IdentityManager::Observer>
Expand Down

0 comments on commit a36e0d0

Please sign in to comment.