Commit 261bb749 authored by David Bienvenu's avatar David Bienvenu Committed by Commit Bot

desktop-pwas: Don't include gaia name in file association menu.

crrev.com/c/1845766 added the signed in Gaia name to the local
profile name for displaying a profile name in the user menu
and profile switcher.

Since the pwa+profile name in the file association open with
menu is static, I think it's better not to include the
signed in gaia name - and it looks odd the way it is now
<pwa name>(<profile name>(<gaia name>)).

Bug: 960245
Change-Id: Ic6a1476590c469c413cd8a5fe6883440e23c953b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2075975Reviewed-by: default avatarGreg Thompson <grt@chromium.org>
Reviewed-by: default avatarAlexey Baskakov <loyso@chromium.org>
Commit-Queue: David Bienvenu <davidbienvenu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#745121}
parent 8af98307
...@@ -112,7 +112,7 @@ base::string16 GetAppNameExtensionForProfile( ...@@ -112,7 +112,7 @@ base::string16 GetAppNameExtensionForProfile(
bool has_entry = storage.GetProfileAttributesWithPath(profile_path, &entry); bool has_entry = storage.GetProfileAttributesWithPath(profile_path, &entry);
if (has_entry) { if (has_entry) {
app_name_extension.append(STRING16_LITERAL(" (")); app_name_extension.append(STRING16_LITERAL(" ("));
app_name_extension.append(entry->GetName()); app_name_extension.append(entry->GetLocalProfileName());
app_name_extension.append(STRING16_LITERAL(")")); app_name_extension.append(STRING16_LITERAL(")"));
} }
return app_name_extension; return app_name_extension;
......
...@@ -257,6 +257,23 @@ TEST_F(WebAppFileHandlerRegistrationWinTest, ...@@ -257,6 +257,23 @@ TEST_F(WebAppFileHandlerRegistrationWinTest,
EXPECT_TRUE(ProgIdRegisteredForFileExtension(".doc", app_id(), profile())); EXPECT_TRUE(ProgIdRegisteredForFileExtension(".doc", app_id(), profile()));
} }
// Test that we don't use the gaia name in the file association app name, but
// rather, just the local profile name.
TEST_F(WebAppFileHandlerRegistrationWinTest,
RegisterFileHandlersForWebAppIn2ProfilesWithGaiaName) {
AddAndVerifyFileAssociations(profile(), kAppName, "");
Profile* profile2 =
testing_profile_manager()->CreateTestingProfile("Profile 2");
ProfileAttributesStorage& storage =
profile_manager()->GetProfileAttributesStorage();
ProfileAttributesEntry* entry;
ASSERT_TRUE(
storage.GetProfileAttributesWithPath(profile2->GetPath(), &entry));
entry->SetGAIAName(base::ASCIIToUTF16("gaia user"));
AddAndVerifyFileAssociations(profile2, kAppName, " (Profile 2)");
}
// When an app is registered in two profiles, and then unregistered in one of // When an app is registered in two profiles, and then unregistered in one of
// them, the remaining registration should no longer be profile-specific. It // them, the remaining registration should no longer be profile-specific. It
// should not have the profile name in app_launcher executable name, or the // should not have the profile name in app_launcher executable name, or the
......
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