Skip to content

Commit

Permalink
[Merge to 118] Update UpdateNotification content
Browse files Browse the repository at this point in the history
Update the notification strings, links, image.
Also enable the flag in this cl

Bug: b/284978852
Change-Id: I19c36a5af7da4ca8f438212e83a10dd6ee2e0990
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4908232
Reviewed-by: Ahmed Fakhry <afakhry@chromium.org>
Commit-Queue: Jiaming Cheng <jiamingc@chromium.org>
Reviewed-by: Alex Newcomer <newcomer@chromium.org>
Cr-Commit-Position: refs/branch-heads/5993@{#1072}
Cr-Branched-From: 5113507-refs/heads/main@{#1192594}
  • Loading branch information
jiajiabingcheng authored and Chromium LUCI CQ committed Oct 2, 2023
1 parent 60a4a84 commit e2233e3
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 15 deletions.
2 changes: 1 addition & 1 deletion ash/constants/ash_features.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1094,7 +1094,7 @@ BASE_FEATURE(kFeatureManagementUpdateNotification,
base::FEATURE_DISABLED_BY_DEFAULT);
BASE_FEATURE(kUpdateNotification,
"UpdateNotification",
base::FEATURE_DISABLED_BY_DEFAULT);
base::FEATURE_ENABLED_BY_DEFAULT);

// Allows borealis on certain boards whose features are determined by
// FeatureManagement. This feature does not apply to all boards, and does not
Expand Down
3 changes: 3 additions & 0 deletions ash/public/cpp/resources/ash_public_unscaled_resources.grd
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
<include name="IDR_SETTINGS_RGB_KEYBOARD_RAINBOW_COLOR_48_PNG" file="unscaled_resources/rgb_keyboard_rainbow_color_48.png" type="BINDATA" />
<!-- Accessibility animations -->
<include name="IDR_DICTATION_BUBBLE_ANIMATION" file="unscaled_resources/dictation_bubble_animation.json" type="BINDATA"/>
<!-- CBX notification images -->
<include name="IDR_UPDATE_CHROME_DARK" file="unscaled_resources/update_chrome_dark.png" type="BINDATA" />
<include name="IDR_UPDATE_CHROME_LIGHT" file="unscaled_resources/update_chrome_light.png" type="BINDATA" />
<!-- System tray Cast images -->
<include name="IDR_TRAY_CAST_ZERO_STATE_DARK" file="unscaled_resources/tray_cast_zero_state_dark.png" type="BINDATA" />
<include name="IDR_TRAY_CAST_ZERO_STATE_LIGHT" file="unscaled_resources/tray_cast_zero_state_light.png" type="BINDATA" />
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions chrome/app/chromeos_strings.grdp
Original file line number Diff line number Diff line change
Expand Up @@ -2809,10 +2809,10 @@

<!-- Update Notification Strings -->
<message name="IDS_UPDATE_NOTIFICATION_HEADER" desc="Notification title shown for a system update.">
Update <ph name="NAME">$1<ex>Chromebook</ex></ph>.
You’ve been upgraded to <ph name="NAME">$1<ex>Chromebook</ex></ph>.
</message>
<message name="IDS_UPDATE_NOTIFICATION_MESSAGE" desc="Notification shown for a system update.">
Your Chromebook is updated.
New features include Magic Eraser on Google Photos to remove distractions, improved video call tools, and more
</message>

<!-- Update Required Screen Strings-->
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7ceb532596f6f30d9c475ed890dd68e6cfe276ce
6452b937c471fd84ce1209da6e7f8803e40f9820
Original file line number Diff line number Diff line change
@@ -1 +1 @@
9ff7ba07b716473e285c65c1e0f4f5c237b3f224
6452b937c471fd84ce1209da6e7f8803e40f9820
16 changes: 7 additions & 9 deletions chrome/browser/ash/notifications/update_notification.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ namespace {

constexpr char kUpdateNotificationId[] = "chrome://update_notification";

// TODO(b/284978852): Update the link.
constexpr char kUpdateURL[] = "https://www.google.com/chromebook/";
constexpr char kUpdateURL[] =
"https://www.google.com/chromebook/discover/chromebookplus/";

} // namespace

Expand All @@ -52,12 +52,11 @@ void UpdateNotification::ShowNotification() {
message_center::RichNotificationData data;
data.buttons.emplace_back(l10n_util::GetStringUTF16(IDS_LEARN_MORE));

// Product name does not need to be translated.
auto product_name =
l10n_util::GetStringUTF16(ui::GetChromeOSDeviceTypeResourceId());
message_center::Notification notification = CreateSystemNotification(
message_center::NOTIFICATION_TYPE_IMAGE, kUpdateNotificationId,
l10n_util::GetStringFUTF16(IDS_UPDATE_NOTIFICATION_HEADER, product_name),
// Product name does not need to be translated.
l10n_util::GetStringFUTF16(IDS_UPDATE_NOTIFICATION_HEADER,
u"Chromebook Plus"),
l10n_util::GetStringUTF16(IDS_UPDATE_NOTIFICATION_MESSAGE),
std::u16string(), GURL(kUpdateNotificationId),
message_center::NotifierId(message_center::NotifierType::SYSTEM_COMPONENT,
Expand All @@ -69,13 +68,12 @@ void UpdateNotification::ShowNotification() {
weak_factory_.GetWeakPtr())),
gfx::kNoneIcon, message_center::SystemNotificationWarningLevel::NORMAL);

// TODO(b/284978852): Use the images after it's finalized from the UX.
// DarkLightModeController might be nullptr in tests.
auto* dark_light_mode_controller = DarkLightModeController::Get();
const bool use_dark_image = dark_light_mode_controller &&
dark_light_mode_controller->IsDarkModeEnabled();
int image_resource_id = use_dark_image ? IDR_TRAY_CAST_ZERO_STATE_DARK
: IDR_TRAY_CAST_ZERO_STATE_LIGHT;
int image_resource_id =
use_dark_image ? IDR_UPDATE_CHROME_DARK : IDR_UPDATE_CHROME_LIGHT;

notification.set_image(
ui::ImageModel::FromResourceId(image_resource_id).GetImage());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,10 @@ TEST_P(UpdateNotificationTest, ShowNotification) {

// Show the update notification if the flag is enabled.
ASSERT_TRUE(notification);
EXPECT_EQ(u"Your Chromebook is updated.", notification->message());
EXPECT_EQ(
u"New features include Magic Eraser on Google Photos to remove "
u"distractions, improved video call tools, and more",
notification->message());
}

} // namespace ash

0 comments on commit e2233e3

Please sign in to comment.