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

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

Issue 1387383004: Plumb NotifierId to status icon balloons (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@notif_cleanup
Patch Set: Rebase 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 91eb63eccacc6413e7c6caa72af2459077f7811c..fd43576ce039181fe4a46673de6e798e783d5275 100644
--- a/chrome/browser/status_icons/desktop_notification_balloon.cc
+++ b/chrome/browser/status_icons/desktop_notification_balloon.cc
@@ -33,7 +33,6 @@ 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;
@@ -74,7 +73,8 @@ DesktopNotificationBalloon::~DesktopNotificationBalloon() {
void DesktopNotificationBalloon::DisplayBalloon(
const gfx::ImageSkia& icon,
const base::string16& title,
- const base::string16& contents) {
+ const base::string16& contents,
+ const message_center::NotifierId& notifier_id) {
// Allowing IO access is required here to cover the corner case where
// there is no last used profile and the default one is loaded.
// IO access won't be required for normal uses.
@@ -86,16 +86,9 @@ void DesktopNotificationBalloon::DisplayBalloon(
NotificationDelegate* delegate =
new DummyNotificationDelegate(base::IntToString(id_count_++), profile_);
- // 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://crbug.com/542232
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);
+ contents, gfx::Image(icon), notifier_id, 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/status_icons/desktop_notification_balloon.h ('k') | chrome/browser/status_icons/status_icon.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698