Commit f91102f2 authored by Alex Ilin's avatar Alex Ilin Committed by Chromium LUCI CQ

[profiles] Change default profile name for enterprise accounts

This CL changes the default profile name used for enterprise profiles
created through the new signed-in profile creation flow. The name
changes from "Work" to "<account-domain>.com".

The profiles created with SAML accounts are still named as "Work".

Bug: 1166712
Change-Id: I1edbe953c3c0857f6c0a4899f2f1120a313e9220
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2627404
Commit-Queue: Alex Ilin <alexilin@chromium.org>
Reviewed-by: default avatarDavid Roger <droger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#843720}
parent 0e054a0b
...@@ -310,7 +310,10 @@ bool ArePublicSessionRestrictionsEnabled() { ...@@ -310,7 +310,10 @@ bool ArePublicSessionRestrictionsEnabled() {
} }
#if !BUILDFLAG(IS_CHROMEOS_ASH) #if !BUILDFLAG(IS_CHROMEOS_ASH)
base::string16 GetDefaultNameForNewEnterpriseProfile() { base::string16 GetDefaultNameForNewEnterpriseProfile(
const std::string& hosted_domain) {
if (AccountInfo::IsManaged(hosted_domain))
return base::UTF8ToUTF16(hosted_domain);
return l10n_util::GetStringUTF16( return l10n_util::GetStringUTF16(
IDS_SIGNIN_DICE_WEB_INTERCEPT_ENTERPRISE_PROFILE_NAME); IDS_SIGNIN_DICE_WEB_INTERCEPT_ENTERPRISE_PROFILE_NAME);
} }
...@@ -320,7 +323,7 @@ base::string16 GetDefaultNameForNewSignedInProfile( ...@@ -320,7 +323,7 @@ base::string16 GetDefaultNameForNewSignedInProfile(
DCHECK(account_info.IsValid()); DCHECK(account_info.IsValid());
if (!account_info.IsManaged()) if (!account_info.IsManaged())
return base::UTF8ToUTF16(account_info.given_name); return base::UTF8ToUTF16(account_info.given_name);
return GetDefaultNameForNewEnterpriseProfile(); return GetDefaultNameForNewEnterpriseProfile(account_info.hosted_domain);
} }
base::string16 GetDefaultNameForNewSignedInProfileWithIncompleteInfo( base::string16 GetDefaultNameForNewSignedInProfileWithIncompleteInfo(
......
...@@ -121,7 +121,8 @@ bool ArePublicSessionRestrictionsEnabled(); ...@@ -121,7 +121,8 @@ bool ArePublicSessionRestrictionsEnabled();
#if !BUILDFLAG(IS_CHROMEOS_ASH) #if !BUILDFLAG(IS_CHROMEOS_ASH)
// Returns the default name for a new enterprise profile. // Returns the default name for a new enterprise profile.
base::string16 GetDefaultNameForNewEnterpriseProfile(); base::string16 GetDefaultNameForNewEnterpriseProfile(
const std::string& hosted_domain = std::string());
// Returns the default name for a new signed-in profile, based on // Returns the default name for a new signed-in profile, based on
// `account_info`. // `account_info`.
......
...@@ -645,7 +645,7 @@ IN_PROC_BROWSER_TEST_F(ProfilePickerEnterpriseCreationFlowBrowserTest, ...@@ -645,7 +645,7 @@ IN_PROC_BROWSER_TEST_F(ProfilePickerEnterpriseCreationFlowBrowserTest,
.GetProfileAttributesWithPath( .GetProfileAttributesWithPath(
profile_being_created->GetPath(), &entry)); profile_being_created->GetPath(), &entry));
EXPECT_FALSE(entry->IsEphemeral()); EXPECT_FALSE(entry->IsEphemeral());
EXPECT_EQ(entry->GetLocalProfileName(), base::UTF8ToUTF16(kWork)); EXPECT_EQ(entry->GetLocalProfileName(), base::UTF8ToUTF16("enterprise.com"));
// The color is not applied for enterprise users. // The color is not applied for enterprise users.
EXPECT_FALSE(ThemeServiceFactory::GetForProfile(profile_being_created) EXPECT_FALSE(ThemeServiceFactory::GetForProfile(profile_being_created)
...@@ -698,7 +698,7 @@ IN_PROC_BROWSER_TEST_F(ProfilePickerEnterpriseCreationFlowBrowserTest, ...@@ -698,7 +698,7 @@ IN_PROC_BROWSER_TEST_F(ProfilePickerEnterpriseCreationFlowBrowserTest,
.GetProfileAttributesWithPath( .GetProfileAttributesWithPath(
profile_being_created->GetPath(), &entry)); profile_being_created->GetPath(), &entry));
EXPECT_FALSE(entry->IsEphemeral()); EXPECT_FALSE(entry->IsEphemeral());
EXPECT_EQ(entry->GetLocalProfileName(), base::UTF8ToUTF16(kWork)); EXPECT_EQ(entry->GetLocalProfileName(), base::UTF8ToUTF16("enterprise.com"));
// The color is not applied if the user enters settings. // The color is not applied if the user enters settings.
EXPECT_FALSE(ThemeServiceFactory::GetForProfile(profile_being_created) EXPECT_FALSE(ThemeServiceFactory::GetForProfile(profile_being_created)
->UsingAutogeneratedTheme()); ->UsingAutogeneratedTheme());
......
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