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

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

Issue 18662006: Support creating progress bar notification for Windows (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix per feedbacks Created 7 years, 5 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') | ui/message_center/notification_types.h » ('j') | 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_types.h" 8 #include "ui/message_center/notification_types.h"
9 9
10 namespace { 10 namespace {
11 unsigned g_next_serial_number_ = 0; 11 unsigned g_next_serial_number_ = 0;
12 } 12 }
13 13
14 namespace message_center { 14 namespace message_center {
15 15
16 NotificationItem::NotificationItem(const string16& title, 16 NotificationItem::NotificationItem(const string16& title,
17 const string16& message) 17 const string16& message)
18 : title(title), 18 : title(title),
19 message(message) { 19 message(message) {
20 } 20 }
21 21
22 ButtonInfo::ButtonInfo(const string16& title) 22 ButtonInfo::ButtonInfo(const string16& title)
23 : title(title) { 23 : title(title) {
24 } 24 }
25 25
26 RichNotificationData::RichNotificationData() 26 RichNotificationData::RichNotificationData()
27 : priority(DEFAULT_PRIORITY), 27 : priority(DEFAULT_PRIORITY),
28 never_timeout(false), 28 never_timeout(false),
29 timestamp(base::Time::Now()) {} 29 timestamp(base::Time::Now()),
30 progress(0) {}
30 31
31 RichNotificationData::RichNotificationData(const RichNotificationData& other) 32 RichNotificationData::RichNotificationData(const RichNotificationData& other)
32 : priority(other.priority), 33 : priority(other.priority),
33 never_timeout(other.never_timeout), 34 never_timeout(other.never_timeout),
34 timestamp(other.timestamp), 35 timestamp(other.timestamp),
35 expanded_message(other.expanded_message), 36 expanded_message(other.expanded_message),
36 image(other.image), 37 image(other.image),
37 items(other.items), 38 items(other.items),
39 progress(other.progress),
38 buttons(other.buttons) {} 40 buttons(other.buttons) {}
39 41
40 RichNotificationData::~RichNotificationData() {} 42 RichNotificationData::~RichNotificationData() {}
41 43
42 Notification::Notification(NotificationType type, 44 Notification::Notification(NotificationType type,
43 const std::string& id, 45 const std::string& id,
44 const string16& title, 46 const string16& title,
45 const string16& message, 47 const string16& message,
46 const gfx::Image& icon, 48 const gfx::Image& icon,
47 const string16& display_source, 49 const string16& display_source,
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 return; 110 return;
109 optional_fields_.buttons[index].icon = icon; 111 optional_fields_.buttons[index].icon = icon;
110 } 112 }
111 113
112 void Notification::SetSystemPriority() { 114 void Notification::SetSystemPriority() {
113 optional_fields_.priority = SYSTEM_PRIORITY; 115 optional_fields_.priority = SYSTEM_PRIORITY;
114 optional_fields_.never_timeout = true; 116 optional_fields_.never_timeout = true;
115 } 117 }
116 118
117 } // namespace message_center 119 } // namespace message_center
OLDNEW
« no previous file with comments | « ui/message_center/notification.h ('k') | ui/message_center/notification_types.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698