0

Update shared with you string for continue section

Also, enabled the string with the sharing user info by default.
(Note that this feature is still effectively disabled by default
because it's only used when recent drive files in launcher are
enabled.)

Change-Id: I7571a683a85ff12861e127bd72969945379dcf06
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5298398
Commit-Queue: Toni Barzic <tbarzic@chromium.org>
Reviewed-by: Matthew Mourgos <mmourgos@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1261684}
This commit is contained in:
Toni Barzic
2024-02-16 16:23:37 +00:00
committed by Chromium LUCI CQ
parent 300a3d0d56
commit ceacf5e760
4 changed files with 42 additions and 31 deletions

@ -6852,7 +6852,7 @@ New install
<ph name="user">$1<ex>John Doe</ex></ph> modified
</message>
<message name="IDS_FILE_SUGGESTION_JUSTIFICATION_GENERIC_SHARED_ACTION" desc="Part of the file suggestion chip UI in Chrome OS launcher. The suggestion chip provides users suggestions for files they may want to open based on the recent activity. The suggestion contains the file name, and a justification describing why the file was suggested (which contains the user action that prompted suggestion, followed by the time the action was taken). The justification is displayed under the file name. This string is the justification action text shown when the file is suggested because another user recently shared the file with the user (file suggestions may be shown for Google Drive files).">
Shared
Shared with you
</message>
<message name="IDS_FILE_SUGGESTION_JUSTIFICATION_USER_SHARED_ACTION" desc="Part of the file suggestion chip UI in Chrome OS launcher. The suggestion chip provides users suggestions for files they may want to open based on the recent activity. The suggestion contains the file name, and a justification describing why the file was suggested (which contains the user action that prompted suggestion, followed by the time the action was taken). The justification is displayed under the file name. This string is the justification action text shown when the file is suggested because another user recently shared the file with the user (file suggestions may be shown for Google Drive files). The string has a placeholder that will be replaced by the name of the user that shared the file with the user seeing the suggestion.">
<ph name="user">$1<ex>John Doe</ex></ph> shared

@ -1 +1 @@
7b8e27ec10ec30a55acb0cf13532b4f3efbc4f5c
cafc86139e9033152c94fba521a08f1b2941b6a5

@ -2604,7 +2604,7 @@ BASE_FEATURE(kShowPlayInDemoMode,
// files shown because they have been recently shared with the user.
BASE_FEATURE(kShowSharingUserInLauncherContinueSection,
"ShowSharingUserInLauncherContinueSection",
base::FEATURE_DISABLED_BY_DEFAULT);
base::FEATURE_ENABLED_BY_DEFAULT);
// Suppresses the first end of life warning shown 180 days before the AUE date.
BASE_FEATURE(kSuppressFirstEolWarning,
@ -4296,8 +4296,9 @@ bool IsShimlessRMA3pDiagnosticsDevModeEnabled() {
}
bool IsShowSharingUserInLauncherContinueSectionEnabled() {
return base::FeatureList::IsEnabled(
kShowSharingUserInLauncherContinueSection);
return IsLauncherContinueSectionWithRecentsEnabled() &&
base::FeatureList::IsEnabled(
kShowSharingUserInLauncherContinueSection);
}
bool IsSmdsSupportEnabled() {

@ -156,7 +156,11 @@ class FakeSearchQuery : public drivefs::mojom::SearchQuery {
class DriveRecentFileSuggestionProviderTest : public ::testing::Test {
public:
DriveRecentFileSuggestionProviderTest() = default;
DriveRecentFileSuggestionProviderTest() {
scoped_feature_list_.InitWithFeatures(
{ash::features::kLauncherContinueSectionWithRecents},
{ash::features::kShowSharingUserInLauncherContinueSection});
}
DriveRecentFileSuggestionProviderTest(
const DriveRecentFileSuggestionProviderTest&) = delete;
DriveRecentFileSuggestionProviderTest& operator=(
@ -265,15 +269,21 @@ class DriveRecentFileSuggestionProviderTest : public ::testing::Test {
std::unique_ptr<drive::FakeDriveFsHelper> fake_drivefs_helper_;
raw_ptr<drive::DriveIntegrationService> integration_service_ = nullptr;
base::test::ScopedFeatureList scoped_feature_list_{
ash::features::kLauncherContinueSectionWithRecents};
base::test::ScopedFeatureList scoped_feature_list_;
};
class DriveRecentFileSuggestionProviderWithSharingUserTest
: public DriveRecentFileSuggestionProviderTest {
public:
DriveRecentFileSuggestionProviderWithSharingUserTest() {
scoped_feature_list_.InitWithFeatures(
{ash::features::kLauncherContinueSectionWithRecents,
ash::features::kShowSharingUserInLauncherContinueSection},
{});
}
private:
base::test::ScopedFeatureList scoped_feature_list_{
ash::features::kShowSharingUserInLauncherContinueSection};
base::test::ScopedFeatureList scoped_feature_list_;
};
// Verifies that file suggest service returns empty drive suggestions when drive
@ -685,12 +695,12 @@ TEST_F(DriveRecentFileSuggestionProviderTest, SharedItems) {
u"You viewed · just now"),
SuggestionInfo(
root.Append("Modified last, not viewed by user"),
u"Shared · just now"),
u"Shared with you · just now"),
SuggestionInfo(root.Append("Shared"),
u"Shared · Dec 3"),
u"Shared with you · Dec 3"),
SuggestionInfo(
root.Append("Shared with sharing user info"),
u"Shared · Dec 2")));
u"Shared with you · Dec 2")));
result_waiter.Quit();
})));
@ -827,9 +837,9 @@ TEST_F(DriveRecentFileSuggestionProviderWithSharingUserTest, SharedItems) {
u"You viewed · just now"),
SuggestionInfo(
root.Append("Modified last, not viewed by user"),
u"Shared · just now"),
u"Shared with you · just now"),
SuggestionInfo(root.Append("Shared"),
u"Shared · Dec 3"),
u"Shared with you · Dec 3"),
SuggestionInfo(
root.Append("Shared with sharing user info"),
u"Test User 2 shared · Dec 2")));
@ -1192,7 +1202,7 @@ TEST_F(DriveRecentFileSuggestionProviderTest, LastViewedSearchFailed) {
u"Modified · Dec 2"),
SuggestionInfo(
root.Append("Shared with sharing user info"),
u"Shared · Dec 2")));
u"Shared with you · Dec 2")));
result_waiter.Quit();
})));
@ -1300,7 +1310,7 @@ TEST_F(DriveRecentFileSuggestionProviderTest, ModifiedTimeSearchFailed) {
u"You viewed · Dec 3"),
SuggestionInfo(
root.Append("Shared with sharing user info"),
u"Shared · Dec 2")));
u"Shared with you · Dec 2")));
result_waiter.Quit();
})));
@ -1548,7 +1558,7 @@ TEST_F(DriveRecentFileSuggestionProviderTest, SequentialSearches) {
SuggestionInfo(root.Append("Modified last item 1"),
u"Modified · Dec 4"),
SuggestionInfo(root.Append("Shared 1"),
u"Shared · Dec 2")));
u"Shared with you · Dec 2")));
result_waiter_1.Quit();
})));
@ -1574,7 +1584,7 @@ TEST_F(DriveRecentFileSuggestionProviderTest, SequentialSearches) {
SuggestionInfo(root.Append("Modified last item 2"),
u"Modified · Dec 3"),
SuggestionInfo(root.Append("Shared 2"),
u"Shared · Dec 2")));
u"Shared with you · Dec 2")));
result_waiter_2.Quit();
})));
@ -1669,12 +1679,12 @@ TEST_F(DriveRecentFileSuggestionProviderTest, ConcurrentRequests) {
const base::FilePath root = GetDriveRoot();
EXPECT_THAT(
actual_suggestions,
ElementsAre(
SuggestionInfo(root.Append("Viewed last item"),
u"You viewed · just now"),
SuggestionInfo(root.Append("Modified last item"),
u"Modified · Dec 4"),
SuggestionInfo(root.Append("Shared"), u"Shared · Dec 2")));
ElementsAre(SuggestionInfo(root.Append("Viewed last item"),
u"You viewed · just now"),
SuggestionInfo(root.Append("Modified last item"),
u"Modified · Dec 4"),
SuggestionInfo(root.Append("Shared"),
u"Shared with you · Dec 2")));
result_waiter_1.Quit();
})));
@ -1694,12 +1704,12 @@ TEST_F(DriveRecentFileSuggestionProviderTest, ConcurrentRequests) {
const base::FilePath root = GetDriveRoot();
EXPECT_THAT(
actual_suggestions,
ElementsAre(
SuggestionInfo(root.Append("Viewed last item"),
u"You viewed · just now"),
SuggestionInfo(root.Append("Modified last item"),
u"Modified · Dec 4"),
SuggestionInfo(root.Append("Shared"), u"Shared · Dec 2")));
ElementsAre(SuggestionInfo(root.Append("Viewed last item"),
u"You viewed · just now"),
SuggestionInfo(root.Append("Modified last item"),
u"Modified · Dec 4"),
SuggestionInfo(root.Append("Shared"),
u"Shared with you · Dec 2")));
result_waiter_2.Quit();
})));