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

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

Issue 1292003004: Elide origins displayed on web notifications. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Style nit Created 5 years, 4 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) 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 #ifndef CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_H_ 5 #ifndef CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_H_
6 #define CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_H_ 6 #define CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 15 matching lines...) Expand all
26 Notification(const GURL& origin_url, 26 Notification(const GURL& origin_url,
27 const base::string16& title, 27 const base::string16& title,
28 const base::string16& body, 28 const base::string16& body,
29 const gfx::Image& icon, 29 const gfx::Image& icon,
30 const base::string16& display_source, 30 const base::string16& display_source,
31 const std::string& tag, 31 const std::string& tag,
32 NotificationDelegate* delegate); 32 NotificationDelegate* delegate);
33 33
34 Notification( 34 Notification(
35 message_center::NotificationType type, 35 message_center::NotificationType type,
36 const GURL& origin_url,
37 const base::string16& title, 36 const base::string16& title,
38 const base::string16& body, 37 const base::string16& body,
39 const gfx::Image& icon, 38 const gfx::Image& icon,
40 const message_center::NotifierId& notifier_id, 39 const message_center::NotifierId& notifier_id,
41 const base::string16& display_source, 40 const base::string16& display_source,
41 const GURL& origin_url,
42 const std::string& tag, 42 const std::string& tag,
43 const message_center::RichNotificationData& rich_notification_data, 43 const message_center::RichNotificationData& rich_notification_data,
44 NotificationDelegate* delegate); 44 NotificationDelegate* delegate);
45 45
46 Notification(const std::string& id, const Notification& notification); 46 Notification(const std::string& id, const Notification& notification);
47 47
48 Notification(const Notification& notification); 48 Notification(const Notification& notification);
49 ~Notification() override; 49 ~Notification() override;
50 Notification& operator=(const Notification& notification); 50 Notification& operator=(const Notification& notification);
51 51
52 // The origin URL of the script which requested the notification.
53 const GURL& origin_url() const { return origin_url_; }
54
55 // A unique identifier used to update (replace) or remove a notification. 52 // A unique identifier used to update (replace) or remove a notification.
56 const std::string& tag() const { return tag_; } 53 const std::string& tag() const { return tag_; }
57 54
58 // Id of the delegate embedded inside this instance. 55 // Id of the delegate embedded inside this instance.
59 std::string delegate_id() const { return delegate()->id(); } 56 std::string delegate_id() const { return delegate()->id(); }
60 57
61 NotificationDelegate* delegate() const { return delegate_.get(); } 58 NotificationDelegate* delegate() const { return delegate_.get(); }
62 59
63 private: 60 private:
64 // The Origin of the page/worker which created this notification.
65 GURL origin_url_;
66
67 // The user-supplied tag for the notification. 61 // The user-supplied tag for the notification.
68 std::string tag_; 62 std::string tag_;
69 63
70 // A proxy object that allows access back to the JavaScript object that 64 // A proxy object that allows access back to the JavaScript object that
71 // represents the notification, for firing events. 65 // represents the notification, for firing events.
72 scoped_refptr<NotificationDelegate> delegate_; 66 scoped_refptr<NotificationDelegate> delegate_;
73 }; 67 };
74 68
75 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_H_ 69 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_H_
OLDNEW
« no previous file with comments | « chrome/browser/notifications/message_center_notifications_browsertest.cc ('k') | chrome/browser/notifications/notification.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698