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

Unified Diff: chrome/browser/status_icons/desktop_notification_balloon.cc

Issue 1395093002: Fix system notifications incorrectly marked as type WEB_PAGE (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@timeout
Patch Set: Address peter's review nits Created 5 years, 2 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
Index: chrome/browser/status_icons/desktop_notification_balloon.cc
diff --git a/chrome/browser/status_icons/desktop_notification_balloon.cc b/chrome/browser/status_icons/desktop_notification_balloon.cc
index c6d2d375e28d3c1f94c98b2e2da13b5652b8a0ea..ea43d8b25e9815342de6122a69466375f8879721 100644
--- a/chrome/browser/status_icons/desktop_notification_balloon.cc
+++ b/chrome/browser/status_icons/desktop_notification_balloon.cc
@@ -17,6 +17,8 @@
#include "chrome/browser/profiles/profile_manager.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/gfx/image/image_skia.h"
+#include "ui/message_center/notification_types.h"
+#include "ui/message_center/notifier_settings.h"
namespace {
@@ -31,6 +33,7 @@ void CloseBalloon(const std::string& id, ProfileID profile_id) {
// Prefix added to the notification ids.
const char kNotificationPrefix[] = "desktop_notification_balloon.";
+const char kNotifierId[] = "status-icons.desktop-notification-balloon";
// Timeout for automatically dismissing the notification balloon.
const size_t kTimeoutSeconds = 6;
@@ -81,10 +84,18 @@ void DesktopNotificationBalloon::DisplayBalloon(
profile = ProfileManager::GetLastUsedProfile();
}
- NotificationDelegate* delegate =
+ DummyNotificationDelegate* delegate =
new DummyNotificationDelegate(base::IntToString(id_count_++), profile_);
- Notification notification(GURL(), title, contents, gfx::Image(icon),
- base::string16(), std::string(), delegate);
+ // TODO(johnme): In theory the desktop notification balloon class can be used
+ // by lots of other features, which would not fall under a single system
+ // component id. So callers should pass in the notifier_id to be used here,
+ // see https://codereview.chromium.org/1387383004.
dewittj 2015/10/09 15:28:38 optional nit: I'd prefer a bug reference to a code
johnme 2015/10/12 13:54:13 Done.
+ Notification notification(message_center::NOTIFICATION_TYPE_SIMPLE, title,
+ contents, gfx::Image(icon),
+ message_center::NotifierId(message_center::NotifierId::SYSTEM_COMPONENT,
+ kNotifierId),
+ base::string16(), GURL(), std::string(),
+ message_center::RichNotificationData(), delegate);
g_browser_process->notification_ui_manager()->Add(notification, profile);
« no previous file with comments | « chrome/browser/notifications/platform_notification_service_impl.cc ('k') | ui/message_center/message_center_style.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698