From b3e54707da467523766deae7c24c9c0b98dbd89f Mon Sep 17 00:00:00 2001 From: "petewil@chromium.org" Date: Thu, 3 Oct 2013 01:33:03 +0000 Subject: Properly map server prioritites to chrome priorities. The notification server priorities are different than the chrome priorities. We should map them so that a server side medium priority is a chrome low priority, and a server side low priority is a chrome min priority. The unit tests are also updated for the new priority mappings. BUG=297255 Review URL: https://codereview.chromium.org/25727004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@226657 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/notifications/sync_notifier/synced_notification.cc | 6 ++---- .../notifications/sync_notifier/synced_notification_unittest.cc | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/chrome/browser/notifications/sync_notifier/synced_notification.cc b/chrome/browser/notifications/sync_notifier/synced_notification.cc index 8394226..2f827c2 100644 --- a/chrome/browser/notifications/sync_notifier/synced_notification.cc +++ b/chrome/browser/notifications/sync_notifier/synced_notification.cc @@ -549,14 +549,12 @@ int SyncedNotification::GetPriority() const { // Convert the prioroty to the scheme used by the notification center. if (protobuf_priority == sync_pb::CoalescedSyncedNotification_Priority_LOW) { - return message_center::LOW_PRIORITY; + return message_center::MIN_PRIORITY; } else if (protobuf_priority == sync_pb::CoalescedSyncedNotification_Priority_STANDARD) { - return message_center::DEFAULT_PRIORITY; + return message_center::LOW_PRIORITY; } else if (protobuf_priority == sync_pb::CoalescedSyncedNotification_Priority_HIGH) { - // High priority synced notifications are considered default priority in - // Chrome. return message_center::DEFAULT_PRIORITY; } else { // Complain if this is a new priority we have not seen before. diff --git a/chrome/browser/notifications/sync_notifier/synced_notification_unittest.cc b/chrome/browser/notifications/sync_notifier/synced_notification_unittest.cc index b372eca..c54825e 100644 --- a/chrome/browser/notifications/sync_notifier/synced_notification_unittest.cc +++ b/chrome/browser/notifications/sync_notifier/synced_notification_unittest.cc @@ -27,7 +27,7 @@ using sync_pb::SyncedNotificationSpecifics; namespace { const int kNotificationPriority = static_cast( - message_center::LOW_PRIORITY); + message_center::MIN_PRIORITY); bool UseRichNotifications() { return message_center::IsRichNotificationEnabled(); -- cgit v1.1