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

Side by Side Diff: ui/message_center/notification.cc

Issue 324583002: The 1st patch to disambiguate message center notifications (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address Justin's comments. Created 6 years, 6 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
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_delegate.h"
9 #include "ui/message_center/notification_types.h" 9 #include "ui/message_center/notification_types.h"
10 10
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 if (index >= optional_fields_.buttons.size()) 119 if (index >= optional_fields_.buttons.size())
120 return; 120 return;
121 optional_fields_.buttons[index].icon = icon; 121 optional_fields_.buttons[index].icon = icon;
122 } 122 }
123 123
124 void Notification::SetSystemPriority() { 124 void Notification::SetSystemPriority() {
125 optional_fields_.priority = SYSTEM_PRIORITY; 125 optional_fields_.priority = SYSTEM_PRIORITY;
126 optional_fields_.never_timeout = true; 126 optional_fields_.never_timeout = true;
127 } 127 }
128 128
129 // static
130 scoped_ptr<Notification> Notification::CreateSystemNotification(
131 const std::string& notification_id,
132 const base::string16& title,
133 const base::string16& message,
134 const gfx::Image& icon,
135 const std::string& system_component_id,
136 const base::Closure& click_callback) {
137 scoped_ptr<Notification> notification(
138 new Notification(
139 NOTIFICATION_TYPE_SIMPLE,
140 notification_id,
141 title,
142 message,
143 icon,
144 base::string16() /* display_source */,
145 NotifierId(NotifierId::SYSTEM_COMPONENT, system_component_id),
146 RichNotificationData(),
147 new HandleNotificationClickedDelegate(click_callback)));
148 notification->SetSystemPriority();
149 return notification.Pass();
150 }
151
152 } // namespace message_center 129 } // namespace message_center
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698