Commit ff9fe81c authored by Aya ElAttar's avatar Aya ElAttar Committed by Commit Bot

Fix a bug in relaunch notification icon

Changed relaunch notification icon to be kBusinessIcon if
the notification style isn't the default value (set by a policy).
This CL is a follow-up to this one crrev.com/c/1630468.

Bug: 1065461
Change-Id: Ia410241ad13cfa2a644eeaf7c46565bc6bb28eb8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2207311
Commit-Queue: Aya Elsayed <ayaelattar@google.com>
Reviewed-by: default avatarAhmed Fakhry <afakhry@chromium.org>
Cr-Commit-Position: refs/heads/master@{#770044}
parent fc98db92
......@@ -217,6 +217,7 @@ aggregate_vector_icons("ash_vector_icons") {
"system_menu_tracing.icon",
"system_menu_timer.icon",
"system_menu_new_user.icon",
"system_menu_update.icon",
"system_menu_usb.icon",
"system_menu_videocam.icon",
"system_menu_volume_high.icon",
......
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
CANVAS_DIMENSIONS, 40,
MOVE_TO, 20, 36,
R_CUBIC_TO, 8.84f, 0, 16, -7.16f, 16, -16,
CUBIC_TO_SHORTHAND, 28.84f, 4, 20, 4,
CUBIC_TO_SHORTHAND, 4, 11.16f, 4, 20,
R_CUBIC_TO, 0, 8.84f, 7.16f, 16, 16, 16,
CLOSE,
R_MOVE_TO, -4, -7,
R_H_LINE_TO, 8,
R_V_LINE_TO, -6,
R_H_LINE_TO, 6,
LINE_TO, 20, 11,
LINE_TO, 10, 23,
R_H_LINE_TO, 6,
R_V_LINE_TO, 6,
CLOSE
CANVAS_DIMENSIONS, 20,
MOVE_TO, 10, 18,
R_CUBIC_TO, 4.42f, 0, 8, -3.58f, 8, -8,
R_CUBIC_TO, 0, -4.42f, -3.58f, -8, -8, -8,
R_CUBIC_TO, -4.42f, 0, -8, 3.58f, -8, 8,
R_CUBIC_TO, 0, 4.42f, 3.58f, 8, 8, 8,
CLOSE,
R_MOVE_TO, -2, -4,
R_H_LINE_TO, 4,
R_V_LINE_TO, -3,
R_H_LINE_TO, 3,
R_LINE_TO, -5, -6,
R_LINE_TO, -5, 6,
R_H_LINE_TO, 3,
R_V_LINE_TO, 3,
CLOSE
......@@ -67,11 +67,18 @@ void UpdateNotificationController::GenerateUpdateNotification(
slow_boot_file_path_exists_ = slow_boot_file_path_exists.value();
}
const bool is_rollback = model_->rollback();
const NotificationStyle notification_style = model_->notification_style();
message_center::SystemNotificationWarningLevel warning_level =
(model_->rollback() ||
model_->notification_style() == NotificationStyle::kAdminRequired)
(is_rollback || notification_style == NotificationStyle::kAdminRequired)
? message_center::SystemNotificationWarningLevel::WARNING
: message_center::SystemNotificationWarningLevel::NORMAL;
const gfx::VectorIcon& notification_icon =
is_rollback ? kSystemMenuRollbackIcon
: (notification_style == NotificationStyle::kDefault)
? kSystemMenuUpdateIcon
: vector_icons::kBusinessIcon;
std::unique_ptr<Notification> notification = CreateSystemNotification(
message_center::NOTIFICATION_TYPE_SIMPLE, kNotificationId,
GetNotificationTitle(), GetNotificationMessage(),
......@@ -83,9 +90,7 @@ void UpdateNotificationController::GenerateUpdateNotification(
base::BindRepeating(
&UpdateNotificationController::HandleNotificationClick,
weak_ptr_factory_.GetWeakPtr())),
model_->rollback() ? kSystemMenuRollbackIcon
: vector_icons::kBusinessIcon,
warning_level);
notification_icon, warning_level);
notification->set_pinned(true);
if (model_->notification_style() == NotificationStyle::kAdminRequired)
......@@ -93,7 +98,7 @@ void UpdateNotificationController::GenerateUpdateNotification(
if (model_->update_required()) {
std::vector<message_center::ButtonInfo> notification_actions;
if (model_->rollback()) {
if (is_rollback) {
notification_actions.push_back(message_center::ButtonInfo(
l10n_util::GetStringUTF16(IDS_ROLLBACK_NOTIFICATION_RESTART_BUTTON)));
} else {
......
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