Commit c1a1691c authored by yoshiki's avatar yoshiki Committed by Commit bot

[Download Notification] change notification type from SIMPLE to BASE_FORMAT

The type SIMPLE is for web notification and we should use the type BASE_FORMAT for normal type notifications.

BUG=489975
TEST=manually

Review URL: https://codereview.chromium.org/1145953002

Cr-Commit-Position: refs/heads/master@{#330765}
parent 0e80c361
......@@ -384,7 +384,7 @@ IN_PROC_BROWSER_TEST_F(DownloadNotificationTest, DownloadFile) {
IDS_DOWNLOAD_STATUS_DOWNLOADED_TITLE,
download_item()->GetFileNameToReportUser().LossyDisplayName()),
GetNotification(notification_id())->title());
EXPECT_EQ(message_center::NOTIFICATION_TYPE_SIMPLE,
EXPECT_EQ(message_center::NOTIFICATION_TYPE_BASE_FORMAT,
GetNotification(notification_id())->type());
// Confirms that there is only one notification.
......@@ -608,7 +608,7 @@ IN_PROC_BROWSER_TEST_F(DownloadNotificationTest, InterruptDownload) {
l10n_util::GetStringUTF16(
IDS_DOWNLOAD_INTERRUPTED_STATUS_NETWORK_ERROR)),
GetNotification(notification_id())->message());
EXPECT_EQ(message_center::NOTIFICATION_TYPE_SIMPLE,
EXPECT_EQ(message_center::NOTIFICATION_TYPE_BASE_FORMAT,
GetNotification(notification_id())->type());
}
......@@ -721,9 +721,9 @@ IN_PROC_BROWSER_TEST_F(DownloadNotificationTest, DownloadMultipleFiles) {
}
// Confirms the types of download notifications are correct.
EXPECT_EQ(message_center::NOTIFICATION_TYPE_SIMPLE,
EXPECT_EQ(message_center::NOTIFICATION_TYPE_BASE_FORMAT,
GetNotification(notification_id1)->type());
EXPECT_EQ(message_center::NOTIFICATION_TYPE_SIMPLE,
EXPECT_EQ(message_center::NOTIFICATION_TYPE_BASE_FORMAT,
GetNotification(notification_id2)->type());
}
......@@ -811,7 +811,7 @@ IN_PROC_BROWSER_TEST_F(DownloadNotificationTest, IncognitoDownloadFile) {
IDS_DOWNLOAD_STATUS_DOWNLOADED_TITLE,
download_item()->GetFileNameToReportUser().LossyDisplayName()),
GetNotification(notification_id())->title());
EXPECT_EQ(message_center::NOTIFICATION_TYPE_SIMPLE,
EXPECT_EQ(message_center::NOTIFICATION_TYPE_BASE_FORMAT,
GetNotification(notification_id())->type());
// Opens the message center.
......@@ -891,9 +891,9 @@ IN_PROC_BROWSER_TEST_F(DownloadNotificationTest,
}
// Confirms the types of download notifications are correct.
EXPECT_EQ(message_center::NOTIFICATION_TYPE_SIMPLE,
EXPECT_EQ(message_center::NOTIFICATION_TYPE_BASE_FORMAT,
GetNotification(notification_id1)->type());
EXPECT_EQ(message_center::NOTIFICATION_TYPE_SIMPLE,
EXPECT_EQ(message_center::NOTIFICATION_TYPE_BASE_FORMAT,
GetNotification(notification_id2)->type());
chrome::CloseWindow(incognito_browser());
......@@ -1044,10 +1044,10 @@ IN_PROC_BROWSER_TEST_F(MultiProfileDownloadNotificationTest,
}
// Confirms the types of download notifications are correct.
EXPECT_EQ(message_center::NOTIFICATION_TYPE_SIMPLE,
EXPECT_EQ(message_center::NOTIFICATION_TYPE_BASE_FORMAT,
GetNotification(notification_id1)->type());
EXPECT_EQ(message_center::NOTIFICATION_TYPE_SIMPLE,
EXPECT_EQ(message_center::NOTIFICATION_TYPE_BASE_FORMAT,
GetNotification(notification_id2)->type());
EXPECT_EQ(message_center::NOTIFICATION_TYPE_SIMPLE,
EXPECT_EQ(message_center::NOTIFICATION_TYPE_BASE_FORMAT,
GetNotification(notification_id3)->type());
}
......@@ -212,7 +212,7 @@ void DownloadNotificationItem::UpdateNotificationData(
}
if (item_->IsDangerous()) {
notification_->set_type(message_center::NOTIFICATION_TYPE_SIMPLE);
notification_->set_type(message_center::NOTIFICATION_TYPE_BASE_FORMAT);
notification_->set_title(GetTitle());
notification_->set_message(GetWarningText());
......@@ -306,8 +306,8 @@ void DownloadNotificationItem::UpdateNotificationData(
(item_->GetState() == content::DownloadItem::INTERRUPTED &&
previous_download_state_ != content::DownloadItem::INTERRUPTED)) {
CloseNotificationByNonUser();
// Changes the type from PROGRESS to SIMPLE.
notification_->set_type(message_center::NOTIFICATION_TYPE_SIMPLE);
// Changes the type from PROGRESS to BASE_FORMAT.
notification_->set_type(message_center::NOTIFICATION_TYPE_BASE_FORMAT);
notification_ui_manager()->Add(*notification_, profile_);
}
} 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