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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/message_center/notification.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/message_center/notification.h" 5 #include "ui/message_center/notification.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "ui/message_center/notification_delegate.h"
8 #include "ui/message_center/notification_types.h" 9 #include "ui/message_center/notification_types.h"
9 10
10 namespace { 11 namespace {
11 unsigned g_next_serial_number_ = 0; 12 unsigned g_next_serial_number_ = 0;
12 } 13 }
13 14
14 namespace message_center { 15 namespace message_center {
15 16
16 NotificationItem::NotificationItem(const string16& title, 17 NotificationItem::NotificationItem(const string16& title,
17 const string16& message) 18 const string16& message)
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 if (index >= optional_fields_.buttons.size()) 113 if (index >= optional_fields_.buttons.size())
113 return; 114 return;
114 optional_fields_.buttons[index].icon = icon; 115 optional_fields_.buttons[index].icon = icon;
115 } 116 }
116 117
117 void Notification::SetSystemPriority() { 118 void Notification::SetSystemPriority() {
118 optional_fields_.priority = SYSTEM_PRIORITY; 119 optional_fields_.priority = SYSTEM_PRIORITY;
119 optional_fields_.never_timeout = true; 120 optional_fields_.never_timeout = true;
120 } 121 }
121 122
123 // static
124 scoped_ptr<Notification> Notification::CreateSystemNotification(
125 const std::string& notification_id,
126 const base::string16& title,
127 const base::string16& message,
128 const gfx::Image& icon,
129 const base::Closure& click_callback) {
130 scoped_ptr<Notification> notification(
131 new Notification(
132 NOTIFICATION_TYPE_SIMPLE,
133 notification_id,
134 title,
135 message,
136 icon,
137 base::string16() /* display_source */,
138 std::string() /* extension_id */,
139 RichNotificationData(),
140 new HandleNotificationClickedDelegate(click_callback)));
141 notification->SetSystemPriority();
142 return notification.Pass();
143 }
144
122 } // namespace message_center 145 } // namespace message_center
OLDNEW
« 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