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, |
(...skipping 25 matching lines...) Expand all Loading... |
36 body_(body), | 36 body_(body), |
37 display_source_(display_source), | 37 display_source_(display_source), |
38 replace_id_(replace_id), | 38 replace_id_(replace_id), |
39 delegate_(delegate) { | 39 delegate_(delegate) { |
40 // "Upconvert" the string parameters to a data: URL. | 40 // "Upconvert" the string parameters to a data: URL. |
41 content_url_ = GURL(DesktopNotificationService::CreateDataUrl( | 41 content_url_ = GURL(DesktopNotificationService::CreateDataUrl( |
42 icon_url, title, body, dir)); | 42 icon_url, title, body, dir)); |
43 } | 43 } |
44 | 44 |
45 Notification::Notification(ui::notifications::NotificationType type, | 45 Notification::Notification(ui::notifications::NotificationType type, |
| 46 const GURL& origin_url, |
46 const GURL& icon_url, | 47 const GURL& icon_url, |
47 const string16& title, | 48 const string16& title, |
48 const string16& body, | 49 const string16& body, |
49 WebKit::WebTextDirection dir, | 50 WebKit::WebTextDirection dir, |
50 const string16& display_source, | 51 const string16& display_source, |
51 const string16& replace_id, | 52 const string16& replace_id, |
52 const DictionaryValue* optional_fields, | 53 const DictionaryValue* optional_fields, |
53 NotificationDelegate* delegate) | 54 NotificationDelegate* delegate) |
54 : type_(type), | 55 : type_(type), |
55 origin_url_(GURL()), | 56 origin_url_(origin_url), |
56 icon_url_(icon_url), | 57 icon_url_(icon_url), |
57 is_html_(false), | 58 is_html_(false), |
58 title_(title), | 59 title_(title), |
59 body_(body), | 60 body_(body), |
60 display_source_(display_source), | 61 display_source_(display_source), |
61 replace_id_(replace_id), | 62 replace_id_(replace_id), |
62 optional_fields_(NULL), | 63 optional_fields_(NULL), |
63 delegate_(delegate) { | 64 delegate_(delegate) { |
64 if (optional_fields) | 65 if (optional_fields) |
65 optional_fields_.reset(optional_fields->DeepCopy()); | 66 optional_fields_.reset(optional_fields->DeepCopy()); |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 body_ = notification.body(); | 114 body_ = notification.body(); |
114 display_source_ = notification.display_source(); | 115 display_source_ = notification.display_source(); |
115 replace_id_ = notification.replace_id(); | 116 replace_id_ = notification.replace_id(); |
116 if (notification.optional_fields()) | 117 if (notification.optional_fields()) |
117 optional_fields_.reset(notification.optional_fields()->DeepCopy()); | 118 optional_fields_.reset(notification.optional_fields()->DeepCopy()); |
118 else | 119 else |
119 optional_fields_.reset(); | 120 optional_fields_.reset(); |
120 delegate_ = notification.delegate(); | 121 delegate_ = notification.delegate(); |
121 return *this; | 122 return *this; |
122 } | 123 } |
OLD | NEW |