Commit 2b77b931 authored by Tetsui Ohkubo's avatar Tetsui Ohkubo Committed by Commit Bot

Remove IsNewStyleNotificationEnabled checks from chrome/browser

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. (*.cc)
- Remove icons that are no longer used. (*.png, *.icon)
Icons that are not removed are referenced in somewhere.

Bug: 757703
Change-Id: Ibfd26747c05d516140026718c093f18bac443cfe
Reviewed-on: https://chromium-review.googlesource.com/810348Reviewed-by: default avatarEvan Stade <estade@chromium.org>
Reviewed-by: default avatarFinnur Thorarinsson <finnur@chromium.org>
Reviewed-by: default avatarDavid Trainor <dtrainor@chromium.org>
Reviewed-by: default avatarMihai Sardarescu <msarda@chromium.org>
Reviewed-by: default avatarDan Erat <derat@chromium.org>
Reviewed-by: default avatarPavel Yatsuk <pavely@chromium.org>
Reviewed-by: default avatarMitsuru Oshima <oshima@chromium.org>
Commit-Queue: Tetsui Ohkubo <tetsui@chromium.org>
Cr-Commit-Position: refs/heads/master@{#523660}
parent 9631babb
...@@ -1403,10 +1403,6 @@ are declared in build/common.gypi. ...@@ -1403,10 +1403,6 @@ are declared in build/common.gypi.
desc="The title of a download notification: the current download status is in progress."> desc="The title of a download notification: the current download status is in progress.">
Paused <ph name="FILE_NAME">$1<ex>somedocument.pdf</ex></ph> Paused <ph name="FILE_NAME">$1<ex>somedocument.pdf</ex></ph>
</message> </message>
<message name="IDS_DOWNLOAD_STATUS_DOWNLOADED_TITLE"
desc="The title of a download notification: the current download status is finished successufully.">
<ph name="FILE_NAME">$1<ex>somedocument.pdf</ex></ph> downloaded
</message>
<message name="IDS_DOWNLOAD_STATUS_DOWNLOAD_FAILED_TITLE" <message name="IDS_DOWNLOAD_STATUS_DOWNLOAD_FAILED_TITLE"
desc="The title of a download notification: the current download status is failed."> desc="The title of a download notification: the current download status is failed.">
<ph name="FILE_NAME">$1<ex>somedocument.pdf</ex></ph> download unsuccessful <ph name="FILE_NAME">$1<ex>somedocument.pdf</ex></ph> download unsuccessful
...@@ -1415,11 +1411,6 @@ are declared in build/common.gypi. ...@@ -1415,11 +1411,6 @@ are declared in build/common.gypi.
desc="The title of a download notification: the current download status is finished successufully."> desc="The title of a download notification: the current download status is finished successufully.">
Download complete Download complete
</message> </message>
<message name="IDS_DOWNLOAD_NOTIFICATION_STATUS"
desc="Size and units downloaded and total, the origin domain, and the current status od download.">
<ph name="DOWNLOAD_RECEIVED_AND_TOTAL">$1<ex>54/154 MB</ex></ph>, <ph name="SUB_STATUS_TEXT">$2<ex>24 secs remaining</ex></ph>
From <ph name="DOWNLOAD_DOMAIN">$3<ex>example.com</ex></ph>
</message>
<message name="IDS_DOWNLOAD_NOTIFICATION_STATUS_COMPLETED" <message name="IDS_DOWNLOAD_NOTIFICATION_STATUS_COMPLETED"
desc="Size and units downloaded, and the origin domain."> desc="Size and units downloaded, and the origin domain.">
<ph name="DOWNLOAD_RECEIVED">$1<ex>154 MB</ex></ph> from <ph name="DOWNLOAD_DOMAIN">$2<ex>example.com</ex></ph> <ph name="DOWNLOAD_RECEIVED">$1<ex>154 MB</ex></ph> from <ph name="DOWNLOAD_DOMAIN">$2<ex>example.com</ex></ph>
......
...@@ -244,9 +244,6 @@ ...@@ -244,9 +244,6 @@
<structure type="chrome_scaled_image" name="IDR_NEWTAB_CHROME_WELCOME_PAGE_THUMBNAIL" file="common/ntp_welcome_thumb.png" /> <structure type="chrome_scaled_image" name="IDR_NEWTAB_CHROME_WELCOME_PAGE_THUMBNAIL" file="common/ntp_welcome_thumb.png" />
</if> </if>
<structure type="chrome_scaled_image" name="IDR_NEWTAB_WEBSTORE_THUMBNAIL" file="ntp_webstore_thumb.png" /> <structure type="chrome_scaled_image" name="IDR_NEWTAB_WEBSTORE_THUMBNAIL" file="ntp_webstore_thumb.png" />
<if expr="chromeos">
<structure type="chrome_scaled_image" name="IDR_NOTIFICATION_ALERT" file="common/notification_alert.png" />
</if>
<if expr="chromeos"> <if expr="chromeos">
<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" />
......
...@@ -39,8 +39,6 @@ aggregate_vector_icons("chrome_vector_icons") { ...@@ -39,8 +39,6 @@ aggregate_vector_icons("chrome_vector_icons") {
"extension.icon", "extension.icon",
"extension_crashed.icon", "extension_crashed.icon",
"file_download.icon", "file_download.icon",
"file_download_incognito.1x.icon",
"file_download_incognito.icon",
"file_download_shelf.icon", "file_download_shelf.icon",
"folder.icon", "folder.icon",
"folder_managed.1x.icon", "folder_managed.1x.icon",
......
// Copyright 2015 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, 33, 15,
LINE_TO, 26, 15,
LINE_TO, 26, 5,
LINE_TO, 16, 5,
LINE_TO, 16, 15,
LINE_TO, 9, 15,
LINE_TO, 21, 27,
CLOSE,
MOVE_TO, 9, 30,
LINE_TO, 9, 34,
LINE_TO, 27, 34,
LINE_TO, 27, 30,
CLOSE,
ROUND_RECT, 27, 27, 13, 13, 1,
MOVE_TO, 31.5f, 38,
CUBIC_TO, 32.33f, 38, 33, 37.33f, 33, 36.5f,
CUBIC_TO, 33, 35.67f, 32.33f, 35, 31.5f, 35,
CUBIC_TO, 30.67f, 35, 30, 35.67f, 30, 36.5f,
CUBIC_TO, 30, 37.33f, 30.67f, 38, 31.5f, 38,
CLOSE,
MOVE_TO, 35.5f, 38,
CUBIC_TO, 36.33f, 38, 37, 37.33f, 37, 36.5f,
CUBIC_TO, 37, 35.67f, 36.33f, 35, 35.5f, 35,
CUBIC_TO, 34.67f, 35, 34, 35.67f, 34, 36.5f,
CUBIC_TO, 34, 37.33f, 34.67f, 38, 35.5f, 38,
CLOSE,
MOVE_TO, 34, 36,
CUBIC_TO, 34.47f, 36.4f, 34.85f, 36.66f, 35, 37,
CUBIC_TO, 34.99f, 36.94f, 35, 36.87f, 35, 37,
CUBIC_TO, 35, 36.36f, 34.55f, 36, 34, 36,
CUBIC_TO, 33.45f, 36, 33, 36.36f, 33, 37,
CUBIC_TO, 33, 36.87f, 33.01f, 36.94f, 33, 37,
CUBIC_TO, 33.15f, 36.66f, 33.53f, 36.4f, 34, 36,
CLOSE,
MOVE_TO, 35.67f, 32,
LINE_TO, 35, 30,
LINE_TO, 34, 31,
LINE_TO, 32, 30,
LINE_TO, 31.33f, 32,
CLOSE,
MOVE_TO, 31, 33,
LINE_TO, 29, 34,
LINE_TO, 38, 34,
LINE_TO, 36, 33,
CLOSE,
// Pupils.
NEW_PATH,
PATH_COLOR_ARGB, 0xFF, 0x97, 0x97, 0x97,
ROUND_RECT, 31, 36, 1, 1, 0,
ROUND_RECT, 35, 36, 1, 1, 0,
END
// Copyright 2015 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,
MOVE_TO, 64, 30,
LINE_TO, 51, 30,
LINE_TO, 51, 10,
LINE_TO, 30, 10,
LINE_TO, 30, 30,
LINE_TO, 17, 30,
LINE_TO, 41, 54,
CLOSE,
MOVE_TO, 51, 67,
LINE_TO, 17, 67,
LINE_TO, 17, 60,
LINE_TO, 51, 60,
CLOSE,
ROUND_RECT, 54, 54, 26, 26, 2,
MOVE_TO, 66, 72,
CUBIC_TO, 66, 73.66f, 64.66f, 75, 63, 75,
CUBIC_TO, 61.34f, 75, 60, 73.66f, 60, 72,
CUBIC_TO, 60, 70.34f, 61.34f, 69, 63, 69,
CUBIC_TO, 64.66f, 69, 66, 70.34f, 66, 72,
CLOSE,
MOVE_TO, 63, 74,
CUBIC_TO, 64.1f, 74, 65, 73.1f, 65, 72,
CUBIC_TO, 65, 70.9f, 64.1f, 70, 63, 70,
CUBIC_TO, 61.9f, 70, 61, 70.9f, 61, 72,
CUBIC_TO, 61, 73.1f, 61.9f, 74, 63, 74,
CLOSE,
MOVE_TO, 74, 72,
CUBIC_TO, 74, 73.66f, 72.66f, 75, 71, 75,
CUBIC_TO, 69.34f, 75, 68, 73.66f, 68, 72,
CUBIC_TO, 68, 70.34f, 69.34f, 69, 71, 69,
CUBIC_TO, 72.66f, 69, 74, 70.34f, 74, 72,
CLOSE,
MOVE_TO, 71, 70,
CUBIC_TO, 69.9f, 70, 69, 70.89f, 69, 72,
CUBIC_TO, 69, 73.1f, 69.89f, 74, 71, 74,
CUBIC_TO, 72.1f, 74, 73, 73.11f, 73, 72,
CUBIC_TO, 73, 70.9f, 72.11f, 70, 71, 70,
CLOSE,
MOVE_TO, 67, 72,
CUBIC_TO, 67.93f, 72, 68.71f, 72.64f, 69, 73.5f,
CUBIC_TO, 68.97f, 73.34f, 69, 73.17f, 69, 73,
CUBIC_TO, 69, 71.9f, 68.1f, 71, 67, 71,
CUBIC_TO, 65.9f, 71, 65, 71.9f, 65, 73,
CUBIC_TO, 65, 73.17f, 65.03f, 73.34f, 65, 73.5f,
CUBIC_TO, 65.29f, 72.64f, 66.07f, 72, 67, 72,
CLOSE,
MOVE_TO, 71.33f, 63,
LINE_TO, 70, 59,
LINE_TO, 67, 60,
LINE_TO, 64, 59,
LINE_TO, 62.67f, 63,
LINE_TO, 71.33f, 63,
CLOSE,
MOVE_TO, 62, 65,
LINE_TO, 58, 67,
LINE_TO, 76, 67,
LINE_TO, 72, 65,
CLOSE,
END
...@@ -350,13 +350,9 @@ void DownloadItemNotification::UpdateNotificationData(bool display, ...@@ -350,13 +350,9 @@ void DownloadItemNotification::UpdateNotificationData(bool display,
DownloadCommands command(item_); DownloadCommands command(item_);
notification_->set_title(GetTitle()); notification_->set_title(GetTitle());
if (message_center::IsNewStyleNotificationEnabled()) { notification_->set_message(GetSubStatusString());
notification_->set_message(GetSubStatusString()); notification_->set_progress_status(GetStatusString());
notification_->set_progress_status(GetStatusString()); notification_->set_use_image_as_icon(true);
notification_->set_use_image_as_icon(true);
} else {
notification_->set_message(GetStatusString());
}
if (item_->IsDangerous()) { if (item_->IsDangerous()) {
notification_->set_type(message_center::NOTIFICATION_TYPE_BASE_FORMAT); notification_->set_type(message_center::NOTIFICATION_TYPE_BASE_FORMAT);
...@@ -454,46 +450,25 @@ void DownloadItemNotification::UpdateNotificationData(bool display, ...@@ -454,46 +450,25 @@ void DownloadItemNotification::UpdateNotificationData(bool display,
void DownloadItemNotification::UpdateNotificationIcon() { void DownloadItemNotification::UpdateNotificationIcon() {
if (item_->IsDangerous()) { if (item_->IsDangerous()) {
DownloadItemModel model(item_); DownloadItemModel model(item_);
if (message_center::IsNewStyleNotificationEnabled()) { SetNotificationIcon(
SetNotificationIcon( kNotificationDownloadIcon,
kNotificationDownloadIcon, model.MightBeMalicious()
model.MightBeMalicious() ? message_center::kSystemNotificationColorCriticalWarning
? message_center::kSystemNotificationColorCriticalWarning : message_center::kSystemNotificationColorWarning);
: message_center::kSystemNotificationColorWarning);
} else {
SetNotificationIcon(vector_icons::kWarningIcon,
model.MightBeMalicious() ? gfx::kGoogleRed700
: gfx::kGoogleYellow700);
}
return; return;
} }
bool is_off_the_record = item_->GetBrowserContext() &&
item_->GetBrowserContext()->IsOffTheRecord();
switch (item_->GetState()) { switch (item_->GetState()) {
case content::DownloadItem::IN_PROGRESS: case content::DownloadItem::IN_PROGRESS:
case content::DownloadItem::COMPLETE: case content::DownloadItem::COMPLETE:
if (message_center::IsNewStyleNotificationEnabled()) { SetNotificationIcon(kNotificationDownloadIcon,
SetNotificationIcon(kNotificationDownloadIcon, message_center::kSystemNotificationColorNormal);
message_center::kSystemNotificationColorNormal);
} else {
if (is_off_the_record) {
SetNotificationIcon(kFileDownloadIncognitoIcon, gfx::kChromeIconGrey);
} else {
SetNotificationIcon(kFileDownloadIcon, gfx::kGoogleBlue500);
}
}
break; break;
case content::DownloadItem::INTERRUPTED: case content::DownloadItem::INTERRUPTED:
if (message_center::IsNewStyleNotificationEnabled()) { SetNotificationIcon(
SetNotificationIcon( kNotificationDownloadIcon,
kNotificationDownloadIcon, message_center::kSystemNotificationColorCriticalWarning);
message_center::kSystemNotificationColorCriticalWarning);
} else {
SetNotificationIcon(vector_icons::kErrorCircleIcon, gfx::kGoogleRed700);
}
break; break;
case content::DownloadItem::CANCELLED: case content::DownloadItem::CANCELLED:
...@@ -507,14 +482,10 @@ void DownloadItemNotification::UpdateNotificationIcon() { ...@@ -507,14 +482,10 @@ void DownloadItemNotification::UpdateNotificationIcon() {
void DownloadItemNotification::SetNotificationIcon(const gfx::VectorIcon& icon, void DownloadItemNotification::SetNotificationIcon(const gfx::VectorIcon& icon,
SkColor color) { SkColor color) {
if (message_center::IsNewStyleNotificationEnabled()) { notification_->set_accent_color(color);
notification_->set_accent_color(color); notification_->set_small_image(gfx::Image(
notification_->set_small_image(gfx::Image( gfx::CreateVectorIcon(icon, message_center::kSmallImageSizeMD, color)));
gfx::CreateVectorIcon(icon, message_center::kSmallImageSizeMD, color))); notification_->set_vector_small_image(icon);
notification_->set_vector_small_image(icon);
} else {
notification_->set_icon(gfx::Image(gfx::CreateVectorIcon(icon, 40, color)));
}
} }
void DownloadItemNotification::OnImageLoaded(const std::string& image_data) { void DownloadItemNotification::OnImageLoaded(const std::string& image_data) {
...@@ -625,13 +596,8 @@ base::string16 DownloadItemNotification::GetTitle() const { ...@@ -625,13 +596,8 @@ base::string16 DownloadItemNotification::GetTitle() const {
} }
break; break;
case content::DownloadItem::COMPLETE: case content::DownloadItem::COMPLETE:
if (message_center::IsNewStyleNotificationEnabled()) { title_text =
title_text = l10n_util::GetStringUTF16(IDS_DOWNLOAD_STATUS_COMPLETE_TITLE);
l10n_util::GetStringUTF16(IDS_DOWNLOAD_STATUS_COMPLETE_TITLE);
} else {
title_text = l10n_util::GetStringFUTF16(
IDS_DOWNLOAD_STATUS_DOWNLOADED_TITLE, file_name);
}
break; break;
case content::DownloadItem::INTERRUPTED: case content::DownloadItem::INTERRUPTED:
title_text = l10n_util::GetStringFUTF16( title_text = l10n_util::GetStringFUTF16(
...@@ -797,10 +763,8 @@ base::string16 DownloadItemNotification::GetSubStatusString() const { ...@@ -797,10 +763,8 @@ base::string16 DownloadItemNotification::GetSubStatusString() const {
// If the file has been removed: Removed // If the file has been removed: Removed
if (item_->GetFileExternallyRemoved()) if (item_->GetFileExternallyRemoved())
return l10n_util::GetStringUTF16(IDS_DOWNLOAD_STATUS_REMOVED); return l10n_util::GetStringUTF16(IDS_DOWNLOAD_STATUS_REMOVED);
else if (message_center::IsNewStyleNotificationEnabled())
return item_->GetFileNameToReportUser().LossyDisplayName();
else else
return base::string16(); return item_->GetFileNameToReportUser().LossyDisplayName();
case content::DownloadItem::CANCELLED: case content::DownloadItem::CANCELLED:
// "Cancelled" // "Cancelled"
return l10n_util::GetStringUTF16(IDS_DOWNLOAD_STATUS_CANCELLED); return l10n_util::GetStringUTF16(IDS_DOWNLOAD_STATUS_CANCELLED);
...@@ -866,16 +830,8 @@ base::string16 DownloadItemNotification::GetStatusString() const { ...@@ -866,16 +830,8 @@ base::string16 DownloadItemNotification::GetStatusString() const {
show_size_ratio ? model.GetProgressSizesString() : show_size_ratio ? model.GetProgressSizesString() :
ui::FormatBytes(item_->GetReceivedBytes()); ui::FormatBytes(item_->GetReceivedBytes());
if (message_center::IsNewStyleNotificationEnabled()) { return l10n_util::GetStringFUTF16(IDS_DOWNLOAD_NOTIFICATION_STATUS_SHORT,
return l10n_util::GetStringFUTF16(IDS_DOWNLOAD_NOTIFICATION_STATUS_SHORT, size, host_name);
size, host_name);
} else {
base::string16 sub_status_text = GetSubStatusString();
// Download is not completed yet: "3.4/5.6 MB, <SUB STATUS>\nFrom
// example.com"
return l10n_util::GetStringFUTF16(IDS_DOWNLOAD_NOTIFICATION_STATUS, size,
sub_status_text, host_name);
}
} }
Browser* DownloadItemNotification::GetBrowser() const { Browser* DownloadItemNotification::GetBrowser() const {
......
...@@ -440,18 +440,10 @@ IN_PROC_BROWSER_TEST_F(DownloadNotificationTest, DownloadFile) { ...@@ -440,18 +440,10 @@ IN_PROC_BROWSER_TEST_F(DownloadNotificationTest, DownloadFile) {
} }
// Checks strings. // Checks strings.
if (message_center::IsNewStyleNotificationEnabled()) { EXPECT_EQ(l10n_util::GetStringUTF16(IDS_DOWNLOAD_STATUS_COMPLETE_TITLE),
EXPECT_EQ(l10n_util::GetStringUTF16(IDS_DOWNLOAD_STATUS_COMPLETE_TITLE), GetNotification(notification_id())->title());
GetNotification(notification_id())->title()); EXPECT_EQ(download_item()->GetFileNameToReportUser().LossyDisplayName(),
EXPECT_EQ(download_item()->GetFileNameToReportUser().LossyDisplayName(), GetNotification(notification_id())->message());
GetNotification(notification_id())->message());
} else {
EXPECT_EQ(
l10n_util::GetStringFUTF16(
IDS_DOWNLOAD_STATUS_DOWNLOADED_TITLE,
download_item()->GetFileNameToReportUser().LossyDisplayName()),
GetNotification(notification_id())->title());
}
EXPECT_EQ(message_center::NOTIFICATION_TYPE_BASE_FORMAT, EXPECT_EQ(message_center::NOTIFICATION_TYPE_BASE_FORMAT,
GetNotification(notification_id())->type()); GetNotification(notification_id())->type());
...@@ -1056,18 +1048,10 @@ IN_PROC_BROWSER_TEST_F(DownloadNotificationTest, IncognitoDownloadFile) { ...@@ -1056,18 +1048,10 @@ IN_PROC_BROWSER_TEST_F(DownloadNotificationTest, IncognitoDownloadFile) {
download_change_notification_observer.Reset(); download_change_notification_observer.Reset();
} }
if (message_center::IsNewStyleNotificationEnabled()) { EXPECT_EQ(l10n_util::GetStringUTF16(IDS_DOWNLOAD_STATUS_COMPLETE_TITLE),
EXPECT_EQ(l10n_util::GetStringUTF16(IDS_DOWNLOAD_STATUS_COMPLETE_TITLE), GetNotification(notification_id())->title());
GetNotification(notification_id())->title()); EXPECT_EQ(download_item()->GetFileNameToReportUser().LossyDisplayName(),
EXPECT_EQ(download_item()->GetFileNameToReportUser().LossyDisplayName(), GetNotification(notification_id())->message());
GetNotification(notification_id())->message());
} else {
EXPECT_EQ(
l10n_util::GetStringFUTF16(
IDS_DOWNLOAD_STATUS_DOWNLOADED_TITLE,
download_item()->GetFileNameToReportUser().LossyDisplayName()),
GetNotification(notification_id())->title());
}
EXPECT_EQ(message_center::NOTIFICATION_TYPE_BASE_FORMAT, EXPECT_EQ(message_center::NOTIFICATION_TYPE_BASE_FORMAT,
GetNotification(notification_id())->type()); GetNotification(notification_id())->type());
......
...@@ -99,23 +99,17 @@ void SigninErrorNotifier::OnErrorChanged() { ...@@ -99,23 +99,17 @@ void SigninErrorNotifier::OnErrorChanged() {
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),
GetMessageBody(), GetMessageBody(), 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 message_center::HandleNotificationClickDelegate( new message_center::HandleNotificationClickDelegate(
base::Bind(&HandleNotificationClick))); base::Bind(&HandleNotificationClick)));
if (message_center::IsNewStyleNotificationEnabled()) { notification.set_accent_color(
notification.set_accent_color( message_center::kSystemNotificationColorWarning);
message_center::kSystemNotificationColorWarning); 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();
// Update or add the notification. // Update or add the notification.
......
...@@ -140,22 +140,16 @@ void SyncErrorNotifier::OnErrorChanged() { ...@@ -140,22 +140,16 @@ void SyncErrorNotifier::OnErrorChanged() {
message_center::NOTIFICATION_TYPE_SIMPLE, notification_id_, message_center::NOTIFICATION_TYPE_SIMPLE, notification_id_,
l10n_util::GetStringUTF16(IDS_SYNC_ERROR_BUBBLE_VIEW_TITLE), l10n_util::GetStringUTF16(IDS_SYNC_ERROR_BUBBLE_VIEW_TITLE),
l10n_util::GetStringUTF16(IDS_SYNC_PASSPHRASE_ERROR_BUBBLE_VIEW_MESSAGE), l10n_util::GetStringUTF16(IDS_SYNC_PASSPHRASE_ERROR_BUBBLE_VIEW_MESSAGE),
message_center::IsNewStyleNotificationEnabled() gfx::Image(), l10n_util::GetStringUTF16(IDS_SIGNIN_ERROR_DISPLAY_SOURCE),
? gfx::Image()
: ui::ResourceBundle::GetSharedInstance().GetImageNamed(
IDR_NOTIFICATION_ALERT),
l10n_util::GetStringUTF16(IDS_SIGNIN_ERROR_DISPLAY_SOURCE),
GURL(notification_id_), notifier_id, GURL(notification_id_), notifier_id,
message_center::RichNotificationData(), message_center::RichNotificationData(),
new SyncNotificationDelegate(profile_)); new SyncNotificationDelegate(profile_));
if (message_center::IsNewStyleNotificationEnabled()) { notification.set_accent_color(
notification.set_accent_color( message_center::kSystemNotificationColorWarning);
message_center::kSystemNotificationColorWarning); 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);
}
display_service->Display(NotificationHandler::Type::TRANSIENT, notification); display_service->Display(NotificationHandler::Type::TRANSIENT, notification);
notification_displayed_ = true; notification_displayed_ = true;
......
...@@ -609,14 +609,10 @@ void ChromeScreenshotGrabber::OnReadScreenshotFileForPreviewCompleted( ...@@ -609,14 +609,10 @@ void ChromeScreenshotGrabber::OnReadScreenshotFileForPreviewCompleted(
new ScreenshotGrabberNotificationDelegate(success, GetProfile(), new ScreenshotGrabberNotificationDelegate(success, GetProfile(),
screenshot_path)); screenshot_path));
notification.set_clickable(success); notification.set_clickable(success);
if (message_center::IsNewStyleNotificationEnabled()) { notification.set_accent_color(message_center::kSystemNotificationColorNormal);
notification.set_accent_color( notification.set_small_image(gfx::Image(gfx::CreateVectorIcon(
message_center::kSystemNotificationColorNormal); kNotificationImageIcon, message_center::kSystemNotificationColorNormal)));
notification.set_small_image(gfx::Image( notification.set_vector_small_image(kNotificationImageIcon);
gfx::CreateVectorIcon(kNotificationImageIcon,
message_center::kSystemNotificationColorNormal)));
notification.set_vector_small_image(kNotificationImageIcon);
}
NotificationDisplayService::GetForProfile(GetProfile()) NotificationDisplayService::GetForProfile(GetProfile())
->Display(NotificationHandler::Type::TRANSIENT, notification); ->Display(NotificationHandler::Type::TRANSIENT, notification);
......
...@@ -47,22 +47,17 @@ ExtensionInstalledNotification::ExtensionInstalledNotification( ...@@ -47,22 +47,17 @@ ExtensionInstalledNotification::ExtensionInstalledNotification(
message_center::NOTIFICATION_TYPE_SIMPLE, extension_id_, message_center::NOTIFICATION_TYPE_SIMPLE, extension_id_,
base::UTF8ToUTF16(extension->name()), base::UTF8ToUTF16(extension->name()),
l10n_util::GetStringUTF16(IDS_EXTENSION_NOTIFICATION_INSTALLED), l10n_util::GetStringUTF16(IDS_EXTENSION_NOTIFICATION_INSTALLED),
gfx::Image(gfx::CreateVectorIcon(vector_icons::kCheckCircleIcon, 40, gfx::Image(),
gfx::kGoogleGreen700)),
l10n_util::GetStringUTF16(IDS_EXTENSION_NOTIFICATION_DISPLAY_SOURCE), l10n_util::GetStringUTF16(IDS_EXTENSION_NOTIFICATION_DISPLAY_SOURCE),
GURL(extension_urls::kChromeWebstoreBaseURL) /* origin_url */, GURL(extension_urls::kChromeWebstoreBaseURL) /* origin_url */,
message_center::NotifierId(message_center::NotifierId::SYSTEM_COMPONENT, message_center::NotifierId(message_center::NotifierId::SYSTEM_COMPONENT,
kNotifierId), kNotifierId),
{}, this); {}, this);
if (message_center::IsNewStyleNotificationEnabled()) { notification.set_accent_color(message_center::kSystemNotificationColorNormal);
notification.set_icon(gfx::Image()); notification.set_small_image(gfx::Image(
notification.set_accent_color( gfx::CreateVectorIcon(kNotificationInstalledIcon,
message_center::kSystemNotificationColorNormal); message_center::kSystemNotificationColorNormal)));
notification.set_small_image(gfx::Image( notification.set_vector_small_image(kNotificationInstalledIcon);
gfx::CreateVectorIcon(kNotificationInstalledIcon,
message_center::kSystemNotificationColorNormal)));
notification.set_vector_small_image(kNotificationInstalledIcon);
}
NotificationDisplayService::GetForProfile(profile_)->Display( NotificationDisplayService::GetForProfile(profile_)->Display(
NotificationHandler::Type::TRANSIENT, notification); NotificationHandler::Type::TRANSIENT, notification);
} }
......
...@@ -18,7 +18,6 @@ aggregate_vector_icons("components_vector_icons") { ...@@ -18,7 +18,6 @@ aggregate_vector_icons("components_vector_icons") {
"close_16.1x.icon", "close_16.1x.icon",
"close_16.icon", "close_16.icon",
"edit.icon", "edit.icon",
"error_circle.icon",
"folder.1x.icon", "folder.1x.icon",
"folder.icon", "folder.icon",
"forward_arrow.1x.icon", "forward_arrow.1x.icon",
......
// Copyright 2015 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.
CIRCLE, 24, 24, 20,
MOVE_TO, 26, 34,
R_H_LINE_TO, -4,
R_V_LINE_TO, -4,
R_H_LINE_TO, 4,
R_V_LINE_TO, 4,
CLOSE,
R_MOVE_TO, 0, -8,
R_H_LINE_TO, -4,
V_LINE_TO, 14,
R_H_LINE_TO, 4,
R_V_LINE_TO, 12,
CLOSE,
END
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