OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "chrome/browser/notifications/notification_object_proxy.h" | 9 #include "chrome/browser/notifications/notification_object_proxy.h" |
10 #include "googleurl/src/gurl.h" | 10 #include "googleurl/src/gurl.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 // The URL (may be data:) containing the contents for the notification. | 30 // The URL (may be data:) containing the contents for the notification. |
31 const GURL& content_url() const { return content_url_; } | 31 const GURL& content_url() const { return content_url_; } |
32 | 32 |
33 // The origin URL of the script which requested the notification. | 33 // The origin URL of the script which requested the notification. |
34 const GURL& origin_url() const { return origin_url_; } | 34 const GURL& origin_url() const { return origin_url_; } |
35 | 35 |
36 void Display() const { proxy()->Display(); } | 36 void Display() const { proxy()->Display(); } |
37 void Error() const { proxy()->Error(); } | 37 void Error() const { proxy()->Error(); } |
38 void Close(bool by_user) const { proxy()->Close(by_user); } | 38 void Close(bool by_user) const { proxy()->Close(by_user); } |
39 | 39 |
| 40 bool IsSame(const Notification& other) const { |
| 41 return (*proxy_).IsSame(*(other.proxy())); |
| 42 } |
| 43 |
40 private: | 44 private: |
41 NotificationObjectProxy* proxy() const { return proxy_.get(); } | 45 NotificationObjectProxy* proxy() const { return proxy_.get(); } |
42 | 46 |
43 // The Origin of the page/worker which created this notification. | 47 // The Origin of the page/worker which created this notification. |
44 GURL origin_url_; | 48 GURL origin_url_; |
45 | 49 |
46 // The URL of the HTML content of the toast (may be a data: URL for simple | 50 // The URL of the HTML content of the toast (may be a data: URL for simple |
47 // string-based notifications). | 51 // string-based notifications). |
48 GURL content_url_; | 52 GURL content_url_; |
49 | 53 |
50 // A proxy object that allows access back to the JavaScript object that | 54 // A proxy object that allows access back to the JavaScript object that |
51 // represents the notification, for firing events. | 55 // represents the notification, for firing events. |
52 scoped_refptr<NotificationObjectProxy> proxy_; | 56 scoped_refptr<NotificationObjectProxy> proxy_; |
53 | 57 |
54 // Disallow assign. Copy constructor written above. | 58 // Disallow assign. Copy constructor written above. |
55 void operator=(const Notification&); | 59 void operator=(const Notification&); |
56 }; | 60 }; |
57 | 61 |
58 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_H_ | 62 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_H_ |
OLD | NEW |