Commit 3eb22b88 authored by Tetsui Ohkubo's avatar Tetsui Ohkubo Committed by Commit Bot

Remove IsNewStyleNotificationEnabled checks from chrome/browser/chromeos

As new style notification is launched in M62, and
IsNewStyleNotificationEnabled() returns true by default on Chrome OS,
we no longer have to check IsNewStyleNotificaitonEnabled().

This CL makes following changes.
- Remove IsNewStyleNotificationEnabled checks under
  chrome/browser/chromeos. (*.cc)
- Remove UI strings that are no longer used. (*.grdp)
- Remove icons that are no longer used. (*.png, *.icon)
Icons that are not removed are referenced in somewhere.

BUG=757703

Change-Id: I46e52295115c3e0a619d1eeefb02321034ce5117
Reviewed-on: https://chromium-review.googlesource.com/802601Reviewed-by: default avatarEvan Stade <estade@chromium.org>
Reviewed-by: default avatarMitsuru Oshima <oshima@chromium.org>
Commit-Queue: Tetsui Ohkubo <tetsui@chromium.org>
Cr-Commit-Position: refs/heads/master@{#522004}
parent 9b99a43f
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
<structure type="chrome_scaled_image" name="IDR_AURA_UBER_TRAY_LOCALE" file="cros/status/status_locale.png" /> <structure type="chrome_scaled_image" name="IDR_AURA_UBER_TRAY_LOCALE" file="cros/status/status_locale.png" />
<structure type="chrome_scaled_image" name="IDR_AURA_UBER_TRAY_NETWORK_FAILED" file="cros/network/status_network_failed.png" /> <structure type="chrome_scaled_image" name="IDR_AURA_UBER_TRAY_NETWORK_FAILED" file="cros/network/status_network_failed.png" />
<structure type="chrome_scaled_image" name="IDR_AURA_UBER_TRAY_NETWORK_FAILED_CELLULAR" file="cros/network/status_cellular_failed.png" /> <structure type="chrome_scaled_image" name="IDR_AURA_UBER_TRAY_NETWORK_FAILED_CELLULAR" file="cros/network/status_cellular_failed.png" />
<structure type="chrome_scaled_image" name="IDR_AURA_UBER_TRAY_NETWORK_VPN" file="cros/network/statusbar_vpn_dark.png" />
<structure type="chrome_scaled_image" name="IDR_AURA_UBER_TRAY_NETWORK_NOTIFICATION_3G" file="cros/network/notification_3g.png" /> <structure type="chrome_scaled_image" name="IDR_AURA_UBER_TRAY_NETWORK_NOTIFICATION_3G" file="cros/network/notification_3g.png" />
<structure type="chrome_scaled_image" name="IDR_AURA_UBER_TRAY_NETWORK_NOTIFICATION_DATASAVER" file="cros/network/notification_datasaver.png" /> <structure type="chrome_scaled_image" name="IDR_AURA_UBER_TRAY_NETWORK_NOTIFICATION_DATASAVER" file="cros/network/notification_datasaver.png" />
<structure type="chrome_scaled_image" name="IDR_AURA_UBER_TRAY_NETWORK_NOTIFICATION_LTE" file="cros/network/notification_lte.png" /> <structure type="chrome_scaled_image" name="IDR_AURA_UBER_TRAY_NETWORK_NOTIFICATION_LTE" file="cros/network/notification_lte.png" />
......
...@@ -4756,9 +4756,6 @@ ...@@ -4756,9 +4756,6 @@
<message name="IDS_HATS_NOTIFICATION_BODY" desc="The body of the notification for Happiness Tracking Survey."> <message name="IDS_HATS_NOTIFICATION_BODY" desc="The body of the notification for Happiness Tracking Survey.">
Let us know how we’re doing. Let us know how we’re doing.
</message> </message>
<message name="IDS_HATS_NOTIFICATION_TAKE_SURVEY_BUTTON" desc="The title of the button in the notification for Happiness Tracking Survey to take the said survey.">
Take survey
</message>
<!-- Lock screen note app toast dialog --> <!-- Lock screen note app toast dialog -->
<message name="IDS_LOCK_SCREEN_NOTE_APP_TOAST_DIALOG_TITLE" desc="Title of the dialog shown to the user when they first launch note taking app from the lock screen - the title contains the launched app's name."> <message name="IDS_LOCK_SCREEN_NOTE_APP_TOAST_DIALOG_TITLE" desc="Title of the dialog shown to the user when they first launch note taking app from the lock screen - the title contains the launched app's name.">
......
...@@ -251,7 +251,6 @@ ...@@ -251,7 +251,6 @@
<structure type="chrome_scaled_image" name="IDR_NOTIFICATION_DRIVE" file="cros/notification_drive.png" /> <structure type="chrome_scaled_image" name="IDR_NOTIFICATION_DRIVE" file="cros/notification_drive.png" />
<structure type="chrome_scaled_image" name="IDR_NOTIFICATION_FINGERPRINT" file="cros/notification_fingerprint.png" /> <structure type="chrome_scaled_image" name="IDR_NOTIFICATION_FINGERPRINT" file="cros/notification_fingerprint.png" />
<structure type="chrome_scaled_image" name="IDR_PORTAL_DETECTION_ALERT" file="cros/captive_portal_icon.png" /> <structure type="chrome_scaled_image" name="IDR_PORTAL_DETECTION_ALERT" file="cros/captive_portal_icon.png" />
<structure type="chrome_scaled_image" name="IDR_ARC_PLAY_STORE_NOTIFICATION" file="cros/notification_play_store.png" />
<structure type="chrome_scaled_image" name="IDR_ARC_PLAY_STORE_OPTIN_IN_PROGRESS_NOTIFICATION" file="cros/notification_play_store_optin_in_progress.png" /> <structure type="chrome_scaled_image" name="IDR_ARC_PLAY_STORE_OPTIN_IN_PROGRESS_NOTIFICATION" file="cros/notification_play_store_optin_in_progress.png" />
<structure type="chrome_scaled_image" name="IDR_NOTIFICATION_SCREENSHOT_ANNOTATE" file="cros/notification_screenshot_annotate.png" /> <structure type="chrome_scaled_image" name="IDR_NOTIFICATION_SCREENSHOT_ANNOTATE" file="cros/notification_screenshot_annotate.png" />
<structure type="chrome_scaled_image" name="IDR_NOTIFICATION_SCREENSHOT_COPY_TO_CLIPBOARD" file="cros/notification_screenshot_copy_to_clipboard.png" /> <structure type="chrome_scaled_image" name="IDR_NOTIFICATION_SCREENSHOT_COPY_TO_CLIPBOARD" file="cros/notification_screenshot_copy_to_clipboard.png" />
......
...@@ -122,7 +122,6 @@ aggregate_vector_icons("chrome_vector_icons") { ...@@ -122,7 +122,6 @@ aggregate_vector_icons("chrome_vector_icons") {
if (is_chromeos) { if (is_chromeos) {
icons += [ icons += [
"arc_migrate_encryption_notification.icon",
"notification_captive_portal.icon", "notification_captive_portal.icon",
"notification_cellular_alert.1x.icon", "notification_cellular_alert.1x.icon",
"notification_cellular_alert.icon", "notification_cellular_alert.icon",
......
// Copyright 2017 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, 80,
PATH_COLOR_ARGB, 0xFF, 0xBD, 0xBD, 0xBD,
ROUND_RECT, 20, 20, 40, 40, 4,
NEW_PATH,
PATH_COLOR_ARGB, 0xFF, 0x75, 0x75, 0x75,
MOVE_TO, 49.91f, 41.31f,
CUBIC_TO, 49.96f, 40.88f, 50, 40.45f, 50, 40,
R_CUBIC_TO, 0, -0.45f, -0.04f, -0.88f, -0.09f, -1.31f,
R_LINE_TO, 2.81f, -2.2f,
R_CUBIC_TO, 0.25f, -0.2f, 0.32f, -0.56f, 0.16f, -0.85f,
R_LINE_TO, -2.67f, -4.61f,
R_CUBIC_TO, -0.16f, -0.29f, -0.52f, -0.4f, -0.81f, -0.29f,
R_LINE_TO, -3.32f, 1.33f,
R_CUBIC_TO, -0.69f, -0.53f, -1.44f, -0.97f, -2.25f, -1.31f,
R_LINE_TO, -0.51f, -3.53f,
R_CUBIC_TO, -0.04f, -0.32f, -0.32f, -0.56f, -0.65f, -0.56f,
R_H_LINE_TO, -5.33f,
R_CUBIC_TO, -0.33f, 0, -0.61f, 0.24f, -0.65f, 0.56f,
R_LINE_TO, -0.51f, 3.53f,
R_CUBIC_TO, -0.81f, 0.33f, -1.56f, 0.79f, -2.25f, 1.31f,
R_LINE_TO, -3.32f, -1.33f,
R_CUBIC_TO, -0.31f, -0.12f, -0.65f, 0, -0.81f, 0.29f,
LINE_TO, 27.12f, 35.64f,
R_CUBIC_TO, -0.17f, 0.29f, -0.09f, 0.65f, 0.16f, 0.85f,
R_LINE_TO, 2.81f, 2.2f,
CUBIC_TO, 30.04f, 39.12f, 30, 39.56f, 30, 40,
R_CUBIC_TO, 0, 0.44f, 0.04f, 0.88f, 0.09f, 1.31f,
R_LINE_TO, -2.81f, 2.2f,
R_CUBIC_TO, -0.25f, 0.2f, -0.32f, 0.56f, -0.16f, 0.85f,
R_LINE_TO, 2.67f, 4.61f,
R_CUBIC_TO, 0.16f, 0.29f, 0.52f, 0.4f, 0.81f, 0.29f,
R_LINE_TO, 3.32f, -1.33f,
R_CUBIC_TO, 0.69f, 0.53f, 1.44f, 0.97f, 2.25f, 1.31f,
R_LINE_TO, 0.51f, 3.53f,
R_CUBIC_TO, 0.04f, 0.32f, 0.32f, 0.56f, 0.65f, 0.56f,
R_H_LINE_TO, 5.33f,
R_CUBIC_TO, 0.33f, 0, 0.61f, -0.24f, 0.65f, -0.56f,
R_LINE_TO, 0.51f, -3.53f,
R_CUBIC_TO, 0.81f, -0.33f, 1.56f, -0.79f, 2.25f, -1.31f,
R_LINE_TO, 3.32f, 1.33f,
R_CUBIC_TO, 0.31f, 0.12f, 0.65f, 0, 0.81f, -0.29f,
R_LINE_TO, 2.67f, -4.61f,
R_CUBIC_TO, 0.16f, -0.29f, 0.09f, -0.65f, -0.16f, -0.85f,
R_LINE_TO, -2.81f, -2.2f,
CLOSE,
MOVE_TO, 40, 44.67f,
R_CUBIC_TO, -2.57f, 0, -4.67f, -2.09f, -4.67f, -4.67f,
R_CUBIC_TO, 0, -2.58f, 2.09f, -4.67f, 4.67f, -4.67f,
R_CUBIC_TO, 2.58f, 0, 4.67f, 2.09f, 4.67f, 4.67f,
R_CUBIC_TO, 0, 2.58f, -2.09f, 4.67f, -4.67f, 4.67f,
CLOSE,
END
...@@ -42,19 +42,7 @@ class ArcAuthNotificationDelegate ...@@ -42,19 +42,7 @@ class ArcAuthNotificationDelegate
public: public:
explicit ArcAuthNotificationDelegate(Profile* profile) : profile_(profile) {} explicit ArcAuthNotificationDelegate(Profile* profile) : profile_(profile) {}
// message_center::NotificationDelegate // message_center::NotificationDelegate:
// TODO(tetsui): Remove this method when IsNewStyleNotificationEnabled() flag
// is removed.
void ButtonClick(int button_index) override {
if (button_index == 0) {
LogUma(arc::OptInActionType::NOTIFICATION_ACCEPTED);
arc::SetArcPlayStoreEnabledForProfile(profile_, true);
} else {
LogUma(arc::OptInActionType::NOTIFICATION_DECLINED);
arc::SetArcPlayStoreEnabledForProfile(profile_, false);
}
}
void Click() override { void Click() override {
LogUma(arc::OptInActionType::NOTIFICATION_ACCEPTED); LogUma(arc::OptInActionType::NOTIFICATION_ACCEPTED);
arc::SetArcPlayStoreEnabledForProfile(profile_, true); arc::SetArcPlayStoreEnabledForProfile(profile_, true);
...@@ -122,35 +110,16 @@ void ArcAuthNotification::Show() { ...@@ -122,35 +110,16 @@ void ArcAuthNotification::Show() {
notifier_id.profile_id = notifier_id.profile_id =
multi_user_util::GetAccountIdFromProfile(profile_).GetUserEmail(); multi_user_util::GetAccountIdFromProfile(profile_).GetUserEmail();
std::unique_ptr<message_center::Notification> notification; std::unique_ptr<message_center::Notification> notification =
if (message_center::IsNewStyleNotificationEnabled()) { message_center::Notification::CreateSystemNotification(
notification = message_center::Notification::CreateSystemNotification( message_center::NOTIFICATION_TYPE_SIMPLE, kFirstRunNotificationId,
message_center::NOTIFICATION_TYPE_SIMPLE, kFirstRunNotificationId, l10n_util::GetStringFUTF16(IDS_ARC_NOTIFICATION_TITLE,
l10n_util::GetStringFUTF16(IDS_ARC_NOTIFICATION_TITLE, ui::GetChromeOSDeviceName()),
ui::GetChromeOSDeviceName()), l10n_util::GetStringUTF16(IDS_ARC_NOTIFICATION_MESSAGE), gfx::Image(),
l10n_util::GetStringUTF16(IDS_ARC_NOTIFICATION_MESSAGE), gfx::Image(), l10n_util::GetStringUTF16(IDS_ARC_NOTIFICATION_DISPLAY_SOURCE),
l10n_util::GetStringUTF16(IDS_ARC_NOTIFICATION_DISPLAY_SOURCE), GURL(), GURL(), notifier_id, message_center::RichNotificationData(),
notifier_id, message_center::RichNotificationData(), new ArcAuthNotificationDelegate(profile_), kNotificationPlayPrismIcon,
new ArcAuthNotificationDelegate(profile_), kNotificationPlayPrismIcon, message_center::SystemNotificationWarningLevel::NORMAL);
message_center::SystemNotificationWarningLevel::NORMAL);
} else {
message_center::RichNotificationData data;
data.buttons.push_back(message_center::ButtonInfo(l10n_util::GetStringUTF16(
IDS_ARC_OPEN_PLAY_STORE_NOTIFICATION_BUTTON)));
data.buttons.push_back(message_center::ButtonInfo(
l10n_util::GetStringUTF16(IDS_ARC_CANCEL_NOTIFICATION_BUTTON)));
ui::ResourceBundle& resource_bundle =
ui::ResourceBundle::GetSharedInstance();
notification = std::make_unique<message_center::Notification>(
message_center::NOTIFICATION_TYPE_SIMPLE, kFirstRunNotificationId,
l10n_util::GetStringFUTF16(IDS_ARC_NOTIFICATION_TITLE,
ui::GetChromeOSDeviceName()),
l10n_util::GetStringUTF16(IDS_ARC_NOTIFICATION_MESSAGE),
resource_bundle.GetImageNamed(IDR_ARC_PLAY_STORE_NOTIFICATION),
l10n_util::GetStringUTF16(IDS_ARC_NOTIFICATION_DISPLAY_SOURCE), GURL(),
notifier_id, data, new ArcAuthNotificationDelegate(profile_));
}
NotificationDisplayService::GetForProfile(profile_)->Display( NotificationDisplayService::GetForProfile(profile_)->Display(
NotificationHandler::Type::TRANSIENT, *notification); NotificationHandler::Type::TRANSIENT, *notification);
} }
......
...@@ -85,30 +85,17 @@ void DoShowArcMigrationSuccessNotification(Profile* profile) { ...@@ -85,30 +85,17 @@ void DoShowArcMigrationSuccessNotification(Profile* profile) {
notifier_id.profile_id = notifier_id.profile_id =
multi_user_util::GetAccountIdFromProfile(profile).GetUserEmail(); multi_user_util::GetAccountIdFromProfile(profile).GetUserEmail();
std::unique_ptr<message_center::Notification> notification; std::unique_ptr<message_center::Notification> notification =
if (message_center::IsNewStyleNotificationEnabled()) { message_center::Notification::CreateSystemNotification(
notification = message_center::Notification::CreateSystemNotification( message_center::NOTIFICATION_TYPE_SIMPLE, kSuccessNotificationId,
message_center::NOTIFICATION_TYPE_SIMPLE, kSuccessNotificationId, l10n_util::GetStringUTF16(IDS_ARC_MIGRATE_ENCRYPTION_SUCCESS_TITLE),
l10n_util::GetStringUTF16(IDS_ARC_MIGRATE_ENCRYPTION_SUCCESS_TITLE), l10n_util::GetStringUTF16(IDS_ARC_MIGRATE_ENCRYPTION_SUCCESS_MESSAGE),
l10n_util::GetStringUTF16(IDS_ARC_MIGRATE_ENCRYPTION_SUCCESS_MESSAGE), gfx::Image(), base::string16(), GURL(), notifier_id,
gfx::Image(), base::string16(), GURL(), notifier_id, message_center::RichNotificationData(),
message_center::RichNotificationData(), scoped_refptr<message_center::NotificationDelegate>(
scoped_refptr<message_center::NotificationDelegate>( new ArcMigrationCompletedNotificationDelegate(profile)),
new ArcMigrationCompletedNotificationDelegate(profile)), ash::kNotificationSettingsIcon,
ash::kNotificationSettingsIcon, message_center::SystemNotificationWarningLevel::NORMAL);
message_center::SystemNotificationWarningLevel::NORMAL);
} else {
notification = std::make_unique<message_center::Notification>(
message_center::NOTIFICATION_TYPE_SIMPLE, kSuccessNotificationId,
l10n_util::GetStringUTF16(IDS_ARC_MIGRATE_ENCRYPTION_SUCCESS_TITLE),
l10n_util::GetStringUTF16(IDS_ARC_MIGRATE_ENCRYPTION_SUCCESS_MESSAGE),
gfx::Image(gfx::CreateVectorIcon(kArcMigrateEncryptionNotificationIcon,
gfx::kPlaceholderColor)),
base::string16(), GURL(), notifier_id,
message_center::RichNotificationData(),
scoped_refptr<message_center::NotificationDelegate>(
new ArcMigrationCompletedNotificationDelegate(profile)));
}
NotificationDisplayService::GetForProfile(profile)->Display( NotificationDisplayService::GetForProfile(profile)->Display(
NotificationHandler::Type::TRANSIENT, *notification); NotificationHandler::Type::TRANSIENT, *notification);
...@@ -140,33 +127,17 @@ void ShowArcMigrationGuideNotification(Profile* profile) { ...@@ -140,33 +127,17 @@ void ShowArcMigrationGuideNotification(Profile* profile) {
: l10n_util::GetStringUTF16( : l10n_util::GetStringUTF16(
IDS_ARC_MIGRATE_ENCRYPTION_NOTIFICATION_MESSAGE); IDS_ARC_MIGRATE_ENCRYPTION_NOTIFICATION_MESSAGE);
std::unique_ptr<message_center::Notification> notification; std::unique_ptr<message_center::Notification> notification =
if (message_center::IsNewStyleNotificationEnabled()) { message_center::Notification::CreateSystemNotification(
notification = message_center::Notification::CreateSystemNotification( message_center::NOTIFICATION_TYPE_SIMPLE, kSuggestNotificationId,
message_center::NOTIFICATION_TYPE_SIMPLE, kSuggestNotificationId, l10n_util::GetStringUTF16(
l10n_util::GetStringUTF16( IDS_ARC_MIGRATE_ENCRYPTION_NOTIFICATION_TITLE),
IDS_ARC_MIGRATE_ENCRYPTION_NOTIFICATION_TITLE), message, gfx::Image(), base::string16(), GURL(), notifier_id,
message, gfx::Image(), base::string16(), GURL(), notifier_id, message_center::RichNotificationData(),
message_center::RichNotificationData(), scoped_refptr<message_center::NotificationDelegate>(
scoped_refptr<message_center::NotificationDelegate>( new ArcMigrationGuideNotificationDelegate()),
new ArcMigrationGuideNotificationDelegate()), ash::kNotificationSettingsIcon,
ash::kNotificationSettingsIcon, message_center::SystemNotificationWarningLevel::NORMAL);
message_center::SystemNotificationWarningLevel::NORMAL);
} else {
message_center::RichNotificationData data;
data.buttons.push_back(message_center::ButtonInfo(l10n_util::GetStringUTF16(
IDS_ARC_MIGRATE_ENCRYPTION_NOTIFICATION_RESTART_BUTTON)));
notification = std::make_unique<message_center::Notification>(
message_center::NOTIFICATION_TYPE_SIMPLE, kSuggestNotificationId,
l10n_util::GetStringUTF16(
IDS_ARC_MIGRATE_ENCRYPTION_NOTIFICATION_TITLE),
message,
gfx::Image(gfx::CreateVectorIcon(kArcMigrateEncryptionNotificationIcon,
gfx::kPlaceholderColor)),
base::string16(), GURL(), notifier_id, data,
scoped_refptr<message_center::NotificationDelegate>(
new ArcMigrationGuideNotificationDelegate()));
}
NotificationDisplayService::GetForProfile(profile)->Display( NotificationDisplayService::GetForProfile(profile)->Display(
NotificationHandler::Type::TRANSIENT, *notification); NotificationHandler::Type::TRANSIENT, *notification);
......
...@@ -83,34 +83,20 @@ void ShowLowDiskSpaceErrorNotification(content::BrowserContext* context) { ...@@ -83,34 +83,20 @@ void ShowLowDiskSpaceErrorNotification(content::BrowserContext* context) {
user_manager::UserManager::Get()->GetPrimaryUser()->GetAccountId(); user_manager::UserManager::Get()->GetPrimaryUser()->GetAccountId();
notifier_id.profile_id = account_id.GetUserEmail(); notifier_id.profile_id = account_id.GetUserEmail();
std::unique_ptr<message_center::Notification> notification; std::unique_ptr<message_center::Notification> notification =
if (message_center::IsNewStyleNotificationEnabled()) { message_center::Notification::CreateSystemNotification(
notification = message_center::Notification::CreateSystemNotification( message_center::NOTIFICATION_TYPE_SIMPLE, kLowDiskSpaceId,
message_center::NOTIFICATION_TYPE_SIMPLE, kLowDiskSpaceId, l10n_util::GetStringUTF16(
l10n_util::GetStringUTF16( IDS_ARC_CRITICALLY_LOW_DISK_NOTIFICATION_TITLE),
IDS_ARC_CRITICALLY_LOW_DISK_NOTIFICATION_TITLE), l10n_util::GetStringUTF16(
l10n_util::GetStringUTF16( IDS_ARC_CRITICALLY_LOW_DISK_NOTIFICATION_MESSAGE),
IDS_ARC_CRITICALLY_LOW_DISK_NOTIFICATION_MESSAGE), gfx::Image(ui::ResourceBundle::GetSharedInstance().GetImageNamed(
gfx::Image(ui::ResourceBundle::GetSharedInstance().GetImageNamed( IDR_DISK_SPACE_NOTIFICATION_CRITICAL)),
IDR_DISK_SPACE_NOTIFICATION_CRITICAL)), l10n_util::GetStringUTF16(IDS_ARC_NOTIFICATION_DISPLAY_SOURCE),
l10n_util::GetStringUTF16(IDS_ARC_NOTIFICATION_DISPLAY_SOURCE), GURL(), GURL(), notifier_id, optional_fields,
notifier_id, optional_fields, new LowDiskSpaceErrorNotificationDelegate(context),
new LowDiskSpaceErrorNotificationDelegate(context), kNotificationStorageFullIcon,
kNotificationStorageFullIcon, message_center::SystemNotificationWarningLevel::CRITICAL_WARNING);
message_center::SystemNotificationWarningLevel::CRITICAL_WARNING);
} else {
notification = std::make_unique<message_center::Notification>(
message_center::NOTIFICATION_TYPE_SIMPLE, kLowDiskSpaceId,
l10n_util::GetStringUTF16(
IDS_ARC_CRITICALLY_LOW_DISK_NOTIFICATION_TITLE),
l10n_util::GetStringUTF16(
IDS_ARC_CRITICALLY_LOW_DISK_NOTIFICATION_MESSAGE),
gfx::Image(ui::ResourceBundle::GetSharedInstance().GetImageNamed(
IDR_DISK_SPACE_NOTIFICATION_CRITICAL)),
l10n_util::GetStringUTF16(IDS_ARC_NOTIFICATION_DISPLAY_SOURCE), GURL(),
notifier_id, optional_fields,
new LowDiskSpaceErrorNotificationDelegate(context));
}
message_center::MessageCenter::Get()->AddNotification( message_center::MessageCenter::Get()->AddNotification(
std::move(notification)); std::move(notification));
} }
......
...@@ -320,22 +320,16 @@ void AuthPolicyCredentialsManager::ShowNotification(int message_id) { ...@@ -320,22 +320,16 @@ void AuthPolicyCredentialsManager::ShowNotification(int message_id) {
message_center::Notification notification( message_center::Notification notification(
message_center::NOTIFICATION_TYPE_SIMPLE, notification_id, message_center::NOTIFICATION_TYPE_SIMPLE, notification_id,
l10n_util::GetStringUTF16(IDS_SIGNIN_ERROR_BUBBLE_VIEW_TITLE), l10n_util::GetStringUTF16(IDS_SIGNIN_ERROR_BUBBLE_VIEW_TITLE),
l10n_util::GetStringUTF16(message_id), l10n_util::GetStringUTF16(message_id), gfx::Image(),
message_center::IsNewStyleNotificationEnabled()
? gfx::Image()
: ui::ResourceBundle::GetSharedInstance().GetImageNamed(
IDR_NOTIFICATION_ALERT),
l10n_util::GetStringUTF16(IDS_SIGNIN_ERROR_DISPLAY_SOURCE), l10n_util::GetStringUTF16(IDS_SIGNIN_ERROR_DISPLAY_SOURCE),
GURL(notification_id), notifier_id, data, GURL(notification_id), notifier_id, data,
new SigninNotificationDelegate()); new SigninNotificationDelegate());
if (message_center::IsNewStyleNotificationEnabled()) { notification.set_accent_color(
notification.set_accent_color( message_center::kSystemNotificationColorCriticalWarning);
message_center::kSystemNotificationColorCriticalWarning); notification.set_small_image(gfx::Image(gfx::CreateVectorIcon(
notification.set_small_image(gfx::Image(gfx::CreateVectorIcon( kNotificationWarningIcon, message_center::kSmallImageSizeMD,
kNotificationWarningIcon, message_center::kSmallImageSizeMD, message_center::kSystemNotificationColorWarning)));
message_center::kSystemNotificationColorWarning))); notification.set_vector_small_image(kNotificationWarningIcon);
notification.set_vector_small_image(kNotificationWarningIcon);
}
notification.SetSystemPriority(); notification.SetSystemPriority();
// Add the notification. // Add the notification.
......
...@@ -33,8 +33,6 @@ namespace chromeos { ...@@ -33,8 +33,6 @@ namespace chromeos {
namespace { namespace {
const char kEolNotificationId[] = "chrome://product_eol"; const char kEolNotificationId[] = "chrome://product_eol";
const SkColor kButtonIconColor = SkColorSetRGB(150, 150, 152);
const SkColor kNotificationIconColor = SkColorSetRGB(219, 68, 55);
// Buttons that appear in notifications. // Buttons that appear in notifications.
enum ButtonIndex { enum ButtonIndex {
...@@ -145,35 +143,26 @@ void EolNotification::Update() { ...@@ -145,35 +143,26 @@ void EolNotification::Update() {
DCHECK_EQ(BUTTON_MORE_INFO, data.buttons.size()); DCHECK_EQ(BUTTON_MORE_INFO, data.buttons.size());
data.buttons.emplace_back(GetStringUTF16(IDS_EOL_MORE_INFO_BUTTON)); data.buttons.emplace_back(GetStringUTF16(IDS_EOL_MORE_INFO_BUTTON));
data.buttons.back().icon = gfx::Image(
CreateVectorIcon(vector_icons::kInfoOutlineIcon, kButtonIconColor));
DCHECK_EQ(BUTTON_DISMISS, data.buttons.size()); DCHECK_EQ(BUTTON_DISMISS, data.buttons.size());
data.buttons.emplace_back(GetStringUTF16(IDS_EOL_DISMISS_BUTTON)); data.buttons.emplace_back(GetStringUTF16(IDS_EOL_DISMISS_BUTTON));
data.buttons.back().icon = gfx::Image(
CreateVectorIcon(vector_icons::kNotificationsOffIcon, kButtonIconColor));
message_center::Notification notification( message_center::Notification notification(
message_center::NOTIFICATION_TYPE_SIMPLE, kEolNotificationId, message_center::NOTIFICATION_TYPE_SIMPLE, kEolNotificationId,
GetStringUTF16(IDS_EOL_NOTIFICATION_TITLE), GetStringUTF16(IDS_EOL_NOTIFICATION_TITLE),
GetStringUTF16(IDS_EOL_NOTIFICATION_EOL), GetStringUTF16(IDS_EOL_NOTIFICATION_EOL), gfx::Image(),
message_center::IsNewStyleNotificationEnabled()
? gfx::Image()
: gfx::Image(CreateVectorIcon(kEolIcon, kNotificationIconColor)),
GetStringUTF16(IDS_EOL_NOTIFICATION_DISPLAY_SOURCE), GetStringUTF16(IDS_EOL_NOTIFICATION_DISPLAY_SOURCE),
GURL(kEolNotificationId), GURL(kEolNotificationId),
message_center::NotifierId(message_center::NotifierId::SYSTEM_COMPONENT, message_center::NotifierId(message_center::NotifierId::SYSTEM_COMPONENT,
kEolNotificationId), kEolNotificationId),
data, new EolNotificationDelegate(profile_)); data, new EolNotificationDelegate(profile_));
if (message_center::IsNewStyleNotificationEnabled()) { notification.set_accent_color(
notification.set_accent_color( message_center::kSystemNotificationColorCriticalWarning);
message_center::kSystemNotificationColorCriticalWarning); notification.set_small_image(gfx::Image(gfx::CreateVectorIcon(
notification.set_small_image(gfx::Image(gfx::CreateVectorIcon( kNotificationEndOfSupportIcon,
kNotificationEndOfSupportIcon, message_center::kSystemNotificationColorCriticalWarning)));
message_center::kSystemNotificationColorCriticalWarning))); notification.set_vector_small_image(kNotificationEndOfSupportIcon);
notification.set_vector_small_image(kNotificationEndOfSupportIcon);
}
NotificationDisplayServiceFactory::GetForProfile(profile_)->Display( NotificationDisplayServiceFactory::GetForProfile(profile_)->Display(
NotificationHandler::Type::TRANSIENT, notification); NotificationHandler::Type::TRANSIENT, notification);
......
...@@ -197,32 +197,20 @@ void HatsNotificationController::OnPortalDetectionCompleted( ...@@ -197,32 +197,20 @@ void HatsNotificationController::OnPortalDetectionCompleted(
network_portal_detector::GetInstance()->RemoveObserver(this); network_portal_detector::GetInstance()->RemoveObserver(this);
// Create and display the notification for the user. // Create and display the notification for the user.
message_center::RichNotificationData optional;
if (!message_center::IsNewStyleNotificationEnabled()) {
optional.buttons.push_back(message_center::ButtonInfo(
l10n_util::GetStringUTF16(IDS_HATS_NOTIFICATION_TAKE_SURVEY_BUTTON)));
}
message_center::Notification notification( message_center::Notification notification(
message_center::NOTIFICATION_TYPE_SIMPLE, kNotificationId, message_center::NOTIFICATION_TYPE_SIMPLE, kNotificationId,
l10n_util::GetStringUTF16(IDS_HATS_NOTIFICATION_TITLE), l10n_util::GetStringUTF16(IDS_HATS_NOTIFICATION_TITLE),
l10n_util::GetStringUTF16(IDS_HATS_NOTIFICATION_BODY), l10n_util::GetStringUTF16(IDS_HATS_NOTIFICATION_BODY), gfx::Image(),
gfx::Image(
gfx::CreateVectorIcon(kGoogleGLogoIcon, gfx::kPlaceholderColor)),
l10n_util::GetStringUTF16(IDS_MESSAGE_CENTER_NOTIFIER_HATS_NAME), l10n_util::GetStringUTF16(IDS_MESSAGE_CENTER_NOTIFIER_HATS_NAME),
GURL(kNotificationOriginUrl), GURL(kNotificationOriginUrl),
message_center::NotifierId(message_center::NotifierId::SYSTEM_COMPONENT, message_center::NotifierId(message_center::NotifierId::SYSTEM_COMPONENT,
kNotifierHats), kNotifierHats),
optional, this); message_center::RichNotificationData(), this);
if (message_center::IsNewStyleNotificationEnabled()) { notification.set_accent_color(message_center::kSystemNotificationColorNormal);
notification.set_icon(gfx::Image()); notification.set_small_image(gfx::Image(gfx::CreateVectorIcon(
notification.set_accent_color( kNotificationGoogleIcon, message_center::kSmallImageSizeMD,
message_center::kSystemNotificationColorNormal); message_center::kSystemNotificationColorNormal)));
notification.set_small_image(gfx::Image(gfx::CreateVectorIcon( notification.set_vector_small_image(kNotificationGoogleIcon);
kNotificationGoogleIcon, message_center::kSmallImageSizeMD,
message_center::kSystemNotificationColorNormal)));
notification.set_vector_small_image(kNotificationGoogleIcon);
}
NotificationDisplayService::GetForProfile(profile_)->Display( NotificationDisplayService::GetForProfile(profile_)->Display(
NotificationHandler::Type::TRANSIENT, notification); NotificationHandler::Type::TRANSIENT, notification);
......
...@@ -60,15 +60,6 @@ base::string16 GetConnectErrorString(const std::string& error_name) { ...@@ -60,15 +60,6 @@ base::string16 GetConnectErrorString(const std::string& error_name) {
return base::string16(); return base::string16();
} }
// TODO(tetsui): Remove with IsNewStyleNotificationEnabled switch.
int GetErrorNotificationIconId(const std::string& network_type) {
if (network_type == shill::kTypeVPN)
return IDR_AURA_UBER_TRAY_NETWORK_VPN;
if (network_type == shill::kTypeCellular)
return IDR_AURA_UBER_TRAY_NETWORK_FAILED_CELLULAR;
return IDR_AURA_UBER_TRAY_NETWORK_FAILED;
}
const gfx::VectorIcon& GetErrorNotificationVectorIcon( const gfx::VectorIcon& GetErrorNotificationVectorIcon(
const std::string& network_type) { const std::string& network_type) {
if (network_type == shill::kTypeVPN) if (network_type == shill::kTypeVPN)
...@@ -86,25 +77,17 @@ void ShowErrorNotification(const std::string& service_path, ...@@ -86,25 +77,17 @@ void ShowErrorNotification(const std::string& service_path,
const base::Closure& callback) { const base::Closure& callback) {
NET_LOG(ERROR) << "ShowErrorNotification: " << service_path << ": " NET_LOG(ERROR) << "ShowErrorNotification: " << service_path << ": "
<< base::UTF16ToUTF8(title); << base::UTF16ToUTF8(title);
std::unique_ptr<message_center::Notification> notification; std::unique_ptr<message_center::Notification> notification =
if (message_center::IsNewStyleNotificationEnabled()) { message_center::Notification::CreateSystemNotification(
notification = message_center::Notification::CreateSystemNotification( message_center::NOTIFICATION_TYPE_SIMPLE, notification_id, title,
message_center::NOTIFICATION_TYPE_SIMPLE, notification_id, title, message, gfx::Image(), base::string16() /* display_source */, GURL(),
message, gfx::Image(), base::string16() /* display_source */, GURL(), message_center::NotifierId(
message_center::NotifierId(message_center::NotifierId::SYSTEM_COMPONENT, message_center::NotifierId::SYSTEM_COMPONENT,
ash::system_notifier::kNotifierNetworkError), ash::system_notifier::kNotifierNetworkError),
message_center::RichNotificationData(), message_center::RichNotificationData(),
new message_center::HandleNotificationClickDelegate(callback), new message_center::HandleNotificationClickDelegate(callback),
GetErrorNotificationVectorIcon(network_type), GetErrorNotificationVectorIcon(network_type),
message_center::SystemNotificationWarningLevel::CRITICAL_WARNING); message_center::SystemNotificationWarningLevel::CRITICAL_WARNING);
} else {
const gfx::Image& icon =
ui::ResourceBundle::GetSharedInstance().GetImageNamed(
GetErrorNotificationIconId(network_type));
notification = message_center::Notification::CreateSystemNotification(
notification_id, title, message, icon,
ash::system_notifier::kNotifierNetworkError, callback);
}
message_center::MessageCenter::Get()->AddNotification( message_center::MessageCenter::Get()->AddNotification(
std::move(notification)); std::move(notification));
} }
......
...@@ -198,57 +198,33 @@ void CupsPrintJobNotification::UpdateNotificationTitle() { ...@@ -198,57 +198,33 @@ void CupsPrintJobNotification::UpdateNotificationTitle() {
} }
void CupsPrintJobNotification::UpdateNotificationIcon() { void CupsPrintJobNotification::UpdateNotificationIcon() {
if (message_center::IsNewStyleNotificationEnabled()) { switch (print_job_->state()) {
switch (print_job_->state()) { case CupsPrintJob::State::STATE_WAITING:
case CupsPrintJob::State::STATE_WAITING: case CupsPrintJob::State::STATE_STARTED:
case CupsPrintJob::State::STATE_STARTED: case CupsPrintJob::State::STATE_PAGE_DONE:
case CupsPrintJob::State::STATE_PAGE_DONE: case CupsPrintJob::State::STATE_SUSPENDED:
case CupsPrintJob::State::STATE_SUSPENDED: case CupsPrintJob::State::STATE_RESUMED:
case CupsPrintJob::State::STATE_RESUMED: notification_->set_accent_color(
notification_->set_accent_color( message_center::kSystemNotificationColorNormal);
message_center::kSystemNotificationColorNormal); notification_->set_vector_small_image(kNotificationPrintingIcon);
notification_->set_vector_small_image(kNotificationPrintingIcon); break;
break; case CupsPrintJob::State::STATE_DOCUMENT_DONE:
case CupsPrintJob::State::STATE_DOCUMENT_DONE: notification_->set_accent_color(
notification_->set_accent_color( message_center::kSystemNotificationColorNormal);
message_center::kSystemNotificationColorNormal); notification_->set_vector_small_image(kNotificationPrintingDoneIcon);
notification_->set_vector_small_image(kNotificationPrintingDoneIcon); break;
break; case CupsPrintJob::State::STATE_CANCELLED:
case CupsPrintJob::State::STATE_CANCELLED: case CupsPrintJob::State::STATE_ERROR:
case CupsPrintJob::State::STATE_ERROR: notification_->set_accent_color(
notification_->set_accent_color( message_center::kSystemNotificationColorWarning);
message_center::kSystemNotificationColorWarning); notification_->set_vector_small_image(kNotificationPrintingWarningIcon);
notification_->set_vector_small_image(kNotificationPrintingWarningIcon); case CupsPrintJob::State::STATE_NONE:
case CupsPrintJob::State::STATE_NONE: break;
break; }
} if (print_job_->state() != CupsPrintJob::State::STATE_NONE) {
if (print_job_->state() != CupsPrintJob::State::STATE_NONE) { notification_->set_small_image(gfx::Image(CreateVectorIcon(
notification_->set_small_image(gfx::Image(CreateVectorIcon( notification_->vector_small_image(), message_center::kSmallImageSizeMD,
notification_->vector_small_image(), notification_->accent_color())));
message_center::kSmallImageSizeMD, notification_->accent_color())));
}
} else {
ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance();
switch (print_job_->state()) {
case CupsPrintJob::State::STATE_WAITING:
case CupsPrintJob::State::STATE_STARTED:
case CupsPrintJob::State::STATE_PAGE_DONE:
case CupsPrintJob::State::STATE_SUSPENDED:
case CupsPrintJob::State::STATE_RESUMED:
notification_->set_icon(
bundle.GetImageNamed(IDR_PRINT_NOTIFICATION_PRINTING));
break;
case CupsPrintJob::State::STATE_DOCUMENT_DONE:
notification_->set_icon(
bundle.GetImageNamed(IDR_PRINT_NOTIFICATION_DONE));
break;
case CupsPrintJob::State::STATE_CANCELLED:
case CupsPrintJob::State::STATE_ERROR:
notification_->set_icon(
bundle.GetImageNamed(IDR_PRINT_NOTIFICATION_ERROR));
case CupsPrintJob::State::STATE_NONE:
break;
}
} }
} }
......
...@@ -34,7 +34,6 @@ aggregate_vector_icons("components_vector_icons") { ...@@ -34,7 +34,6 @@ aggregate_vector_icons("components_vector_icons") {
"microphone.icon", "microphone.icon",
"midi.icon", "midi.icon",
"notifications.icon", "notifications.icon",
"notifications_off.icon",
"protocol_handler.icon", "protocol_handler.icon",
"reload.1x.icon", "reload.1x.icon",
"reload.icon", "reload.icon",
......
// Copyright 2016 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, 24,
MOVE_TO, 20, 18.69f,
LINE_TO, 7.84f, 6.14f,
LINE_TO, 5.27f, 3.49f,
LINE_TO, 4, 4.76f,
R_LINE_TO, 2.8f, 2.8f,
R_V_LINE_TO, 0.01f,
R_CUBIC_TO, -0.52f, 0.99f, -0.8f, 2.16f, -0.8f, 3.42f,
R_V_LINE_TO, 5,
R_LINE_TO, -2, 2,
R_V_LINE_TO, 1,
R_H_LINE_TO, 13.73f,
R_LINE_TO, 2, 2,
LINE_TO, 21, 19.72f,
R_LINE_TO, -1, -1.03f,
CLOSE,
MOVE_TO, 12, 22,
R_CUBIC_TO, 1.11f, 0, 2, -0.89f, 2, -2,
R_H_LINE_TO, -4,
R_CUBIC_TO, 0, 1.11f, 0.89f, 2, 2, 2,
CLOSE,
R_MOVE_TO, 6, -7.32f,
V_LINE_TO, 11,
R_CUBIC_TO, 0, -3.08f, -1.64f, -5.64f, -4.5f, -6.32f,
V_LINE_TO, 4,
R_CUBIC_TO, 0, -0.83f, -0.67f, -1.5f, -1.5f, -1.5f,
R_CUBIC_TO, -0.83f, 0, -1.5f, 0.67f, -1.5f, 1.5f,
R_V_LINE_TO, 0.68f,
R_CUBIC_TO, -0.15f, 0.03f, -0.29f, 0.08f, -0.42f, 0.12f,
R_CUBIC_TO, -0.1f, 0.03f, -0.2f, 0.07f, -0.3f, 0.11f,
R_H_LINE_TO, -0.01f,
R_CUBIC_TO, -0.01f, 0, -0.01f, 0, -0.02f, 0.01f,
R_CUBIC_TO, -0.23f, 0.09f, -0.46f, 0.2f, -0.68f, 0.31f,
R_CUBIC_TO, 0, 0, -0.01f, 0, -0.01f, 0.01f,
LINE_TO, 18, 14.68f,
CLOSE,
END
...@@ -97,9 +97,6 @@ ...@@ -97,9 +97,6 @@
<structure type="chrome_scaled_image" name="IDR_PRINT_NOTIFICATION_PAUSE" file="print_notification/pause.png" /> <structure type="chrome_scaled_image" name="IDR_PRINT_NOTIFICATION_PAUSE" file="print_notification/pause.png" />
<structure type="chrome_scaled_image" name="IDR_PRINT_NOTIFICATION_PLAY" file="print_notification/play.png" /> <structure type="chrome_scaled_image" name="IDR_PRINT_NOTIFICATION_PLAY" file="print_notification/play.png" />
<structure type="chrome_scaled_image" name="IDR_PRINT_NOTIFICATION_HELP" file="print_notification/help.png" /> <structure type="chrome_scaled_image" name="IDR_PRINT_NOTIFICATION_HELP" file="print_notification/help.png" />
<structure type="chrome_scaled_image" name="IDR_PRINT_NOTIFICATION_PRINTING" file="print_notification/print_job_printing.png" />
<structure type="chrome_scaled_image" name="IDR_PRINT_NOTIFICATION_DONE" file="print_notification/print_job_done.png" />
<structure type="chrome_scaled_image" name="IDR_PRINT_NOTIFICATION_ERROR" file="print_notification/print_job_error.png" />
</structures> </structures>
</release> </release>
</grit> </grit>
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