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

Side by Side Diff: chrome/browser/notifications/notification.cc

Issue 10537158: Add support for Ash to Notifications (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 | Annotate | Revision Log
OLDNEW
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 10 matching lines...) Expand all
21 21
22 Notification::Notification(const GURL& origin_url, 22 Notification::Notification(const GURL& origin_url,
23 const GURL& icon_url, 23 const GURL& icon_url,
24 const string16& title, 24 const string16& title,
25 const string16& body, 25 const string16& body,
26 WebKit::WebTextDirection dir, 26 WebKit::WebTextDirection dir,
27 const string16& display_source, 27 const string16& display_source,
28 const string16& replace_id, 28 const string16& replace_id,
29 NotificationDelegate* delegate) 29 NotificationDelegate* delegate)
30 : origin_url_(origin_url), 30 : origin_url_(origin_url),
31 icon_url_(icon_url),
31 is_html_(false), 32 is_html_(false),
32 title_(title), 33 title_(title),
33 body_(body), 34 body_(body),
34 display_source_(display_source), 35 display_source_(display_source),
35 replace_id_(replace_id), 36 replace_id_(replace_id),
36 delegate_(delegate) { 37 delegate_(delegate) {
37 // "Upconvert" the string parameters to a data: URL. 38 // "Upconvert" the string parameters to a data: URL.
38 content_url_ = GURL(DesktopNotificationService::CreateDataUrl( 39 content_url_ = GURL(DesktopNotificationService::CreateDataUrl(
39 icon_url, title, body, dir)); 40 icon_url, title, body, dir));
40 } 41 }
41 42
43 Notification::Notification(const GURL& origin_url,
44 const gfx::ImageSkia& icon,
45 const string16& title,
46 const string16& body,
47 WebKit::WebTextDirection dir,
48 const string16& display_source,
49 const string16& replace_id,
50 NotificationDelegate* delegate)
51 : origin_url_(origin_url),
52 icon_(icon),
53 is_html_(false),
54 title_(title),
55 body_(body),
56 display_source_(display_source),
57 replace_id_(replace_id),
58 delegate_(delegate) {
59 }
60
42 Notification::Notification(const Notification& notification) 61 Notification::Notification(const Notification& notification)
43 : origin_url_(notification.origin_url()), 62 : origin_url_(notification.origin_url()),
63 icon_(notification.icon()),
64 icon_url_(notification.icon_url()),
44 is_html_(notification.is_html()), 65 is_html_(notification.is_html()),
45 content_url_(notification.content_url()), 66 content_url_(notification.content_url()),
46 title_(notification.title()), 67 title_(notification.title()),
47 body_(notification.body()), 68 body_(notification.body()),
48 display_source_(notification.display_source()), 69 display_source_(notification.display_source()),
49 replace_id_(notification.replace_id()), 70 replace_id_(notification.replace_id()),
50 delegate_(notification.delegate()) { 71 delegate_(notification.delegate()) {
51 } 72 }
52 73
53 Notification::~Notification() {} 74 Notification::~Notification() {}
54 75
55 Notification& Notification::operator=(const Notification& notification) { 76 Notification& Notification::operator=(const Notification& notification) {
56 origin_url_ = notification.origin_url(); 77 origin_url_ = notification.origin_url();
78 icon_ = notification.icon_;
79 icon_url_ = notification.icon_url();
57 is_html_ = notification.is_html(); 80 is_html_ = notification.is_html();
58 content_url_ = notification.content_url(); 81 content_url_ = notification.content_url();
59 title_ = notification.title(); 82 title_ = notification.title();
60 body_ = notification.body(); 83 body_ = notification.body();
61 display_source_ = notification.display_source(); 84 display_source_ = notification.display_source();
62 replace_id_ = notification.replace_id(); 85 replace_id_ = notification.replace_id();
63 delegate_ = notification.delegate(); 86 delegate_ = notification.delegate();
64 return *this; 87 return *this;
65 } 88 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698