Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(679)

Unified Diff: chrome/browser/notifications/platform_notification_service_impl.cc

Issue 2006743002: Notification badges are only supported on Android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix test. Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/notifications/platform_notification_service_interactive_uitest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/notifications/platform_notification_service_impl.cc
diff --git a/chrome/browser/notifications/platform_notification_service_impl.cc b/chrome/browser/notifications/platform_notification_service_impl.cc
index f8fdd5c9157c73a0c060cca3f2ddc5c8b740bd37..b02457e24a1a7bcb6cba3b0d2dc735c41d341477 100644
--- a/chrome/browser/notifications/platform_notification_service_impl.cc
+++ b/chrome/browser/notifications/platform_notification_service_impl.cc
@@ -469,10 +469,15 @@ Notification PlatformNotificationServiceImpl::CreateNotificationFromData(
notification.set_renotify(notification_data.renotify);
notification.set_silent(notification_data.silent);
+ // Badges are only supported on Android, primarily because it's the only
+ // platform that makes good use of them in the status bar.
+ // TODO(mvanouwerkerk): ensure no badge is loaded when it will not be used.
+#if defined(OS_ANDROID)
// TODO(peter): Handle different screen densities instead of always using the
// 1x bitmap - crbug.com/585815.
notification.set_small_image(
gfx::Image::CreateFrom1xBitmap(notification_resources.badge));
+#endif // defined(OS_ANDROID)
// Developer supplied action buttons.
std::vector<message_center::ButtonInfo> buttons;
« no previous file with comments | « no previous file | chrome/browser/notifications/platform_notification_service_interactive_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698