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

Unified Diff: ui/message_center/notification.cc

Issue 23075012: Update NetworkStateNotifier to use message_center. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Track deafult_network and reset did_show_out_of_credits on any change Created 7 years, 4 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 | « ui/message_center/notification.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/message_center/notification.cc
diff --git a/ui/message_center/notification.cc b/ui/message_center/notification.cc
index 5d3014e8156294c188f17b9e436396cdb2de4853..692d1406e30795ddab7ce6e18bf817fd19842641 100644
--- a/ui/message_center/notification.cc
+++ b/ui/message_center/notification.cc
@@ -5,6 +5,7 @@
#include "ui/message_center/notification.h"
#include "base/logging.h"
+#include "ui/message_center/notification_delegate.h"
#include "ui/message_center/notification_types.h"
namespace {
@@ -119,4 +120,26 @@ void Notification::SetSystemPriority() {
optional_fields_.never_timeout = true;
}
+// static
+scoped_ptr<Notification> Notification::CreateSystemNotification(
+ const std::string& notification_id,
+ const base::string16& title,
+ const base::string16& message,
+ const gfx::Image& icon,
+ const base::Closure& click_callback) {
+ scoped_ptr<Notification> notification(
+ new Notification(
+ NOTIFICATION_TYPE_SIMPLE,
+ notification_id,
+ title,
+ message,
+ icon,
+ base::string16() /* display_source */,
+ std::string() /* extension_id */,
+ RichNotificationData(),
+ new HandleNotificationClickedDelegate(click_callback)));
+ notification->SetSystemPriority();
+ return notification.Pass();
+}
+
} // namespace message_center
« no previous file with comments | « ui/message_center/notification.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698