OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/notifications/notification.h" | 5 #include "chrome/browser/notifications/notification.h" |
6 | 6 |
7 #include "chrome/browser/notifications/desktop_notification_service.h" | 7 #include "chrome/browser/notifications/desktop_notification_service.h" |
8 | 8 |
9 Notification::Notification(const GURL& origin_url, | 9 Notification::Notification(const GURL& origin_url, |
10 const GURL& content_url, | 10 const GURL& content_url, |
11 const string16& display_source, | 11 const string16& display_source, |
12 const string16& replace_id, | 12 const string16& replace_id, |
13 NotificationDelegate* delegate) | 13 NotificationDelegate* delegate) |
14 : type_(message_center::NOTIFICATION_TYPE_SIMPLE), | 14 : type_(message_center::NOTIFICATION_TYPE_SIMPLE), |
15 origin_url_(origin_url), | 15 origin_url_(origin_url), |
16 is_html_(true), | 16 is_html_(true), |
17 content_url_(content_url), | 17 content_url_(content_url), |
18 display_source_(display_source), | 18 display_source_(display_source), |
19 replace_id_(replace_id), | 19 replace_id_(replace_id), |
20 delegate_(delegate) { | 20 delegate_(delegate) {} |
21 } | |
22 | 21 |
23 Notification::Notification(const GURL& origin_url, | 22 Notification::Notification(const GURL& origin_url, |
24 const GURL& icon_url, | 23 const GURL& icon_url, |
25 const string16& title, | 24 const string16& title, |
26 const string16& body, | 25 const string16& body, |
27 WebKit::WebTextDirection dir, | 26 WebKit::WebTextDirection dir, |
28 const string16& display_source, | 27 const string16& display_source, |
29 const string16& replace_id, | 28 const string16& replace_id, |
30 NotificationDelegate* delegate) | 29 NotificationDelegate* delegate) |
31 : type_(message_center::NOTIFICATION_TYPE_SIMPLE), | 30 : type_(message_center::NOTIFICATION_TYPE_SIMPLE), |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 const string16& replace_id, | 78 const string16& replace_id, |
80 NotificationDelegate* delegate) | 79 NotificationDelegate* delegate) |
81 : type_(message_center::NOTIFICATION_TYPE_SIMPLE), | 80 : type_(message_center::NOTIFICATION_TYPE_SIMPLE), |
82 origin_url_(origin_url), | 81 origin_url_(origin_url), |
83 icon_(icon), | 82 icon_(icon), |
84 is_html_(false), | 83 is_html_(false), |
85 title_(title), | 84 title_(title), |
86 body_(body), | 85 body_(body), |
87 display_source_(display_source), | 86 display_source_(display_source), |
88 replace_id_(replace_id), | 87 replace_id_(replace_id), |
89 delegate_(delegate) { | 88 delegate_(delegate) {} |
90 } | |
91 | 89 |
92 Notification::Notification(const Notification& notification) | 90 Notification::Notification(const Notification& notification) |
93 : type_(notification.type()), | 91 : type_(notification.type()), |
94 origin_url_(notification.origin_url()), | 92 origin_url_(notification.origin_url()), |
95 icon_(notification.icon()), | 93 icon_(notification.icon()), |
96 icon_url_(notification.icon_url()), | 94 icon_url_(notification.icon_url()), |
97 is_html_(notification.is_html()), | 95 is_html_(notification.is_html()), |
98 content_url_(notification.content_url()), | 96 content_url_(notification.content_url()), |
99 title_(notification.title()), | 97 title_(notification.title()), |
100 body_(notification.body()), | 98 body_(notification.body()), |
(...skipping 23 matching lines...) Expand all Loading... |
124 optional_fields_.reset(); | 122 optional_fields_.reset(); |
125 delegate_ = notification.delegate(); | 123 delegate_ = notification.delegate(); |
126 return *this; | 124 return *this; |
127 } | 125 } |
128 | 126 |
129 void Notification::DisableTimeout() { | 127 void Notification::DisableTimeout() { |
130 if (!optional_fields_.get()) | 128 if (!optional_fields_.get()) |
131 optional_fields_.reset(new base::DictionaryValue()); | 129 optional_fields_.reset(new base::DictionaryValue()); |
132 optional_fields_->SetBoolean(message_center::kPrivateNeverTimeoutKey, true); | 130 optional_fields_->SetBoolean(message_center::kPrivateNeverTimeoutKey, true); |
133 } | 131 } |
OLD | NEW |