| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_DELEGATE_H_ |
| 6 #define CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_DELEGATE_H_ | 6 #define CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_DELEGATE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| 11 #include "ui/message_center/notification_delegate.h" | 11 #include "ui/message_center/notification_delegate.h" |
| 12 | 12 |
| 13 namespace content { | 13 namespace content { |
| 14 class WebContents; | 14 class WebContents; |
| 15 } | 15 } |
| 16 | 16 |
| 17 // Delegate for a notification. This class has two roles: to implement callback | 17 // Delegate for a notification. This class has two roles: to implement callback |
| 18 // methods for notification, and to provide an identity of the associated | 18 // methods for notification, and to provide an identity of the associated |
| 19 // notification. | 19 // notification. |
| 20 class NotificationDelegate : public message_center::NotificationDelegate { | 20 class NotificationDelegate : public message_center::NotificationDelegate { |
| 21 public: | 21 public: |
| 22 // Returns unique id of the notification. | 22 // Returns unique id of the notification. |
| 23 virtual std::string id() const = 0; | 23 virtual std::string id() const = 0; |
| 24 | 24 |
| 25 // Returns the WebContents that generated the notification, or NULL. | |
| 26 virtual content::WebContents* GetWebContents() const = 0; | |
| 27 | |
| 28 // Lets the delegate know that no more rendering will be necessary. | |
| 29 virtual void ReleaseRenderViewHost(); | |
| 30 | |
| 31 protected: | 25 protected: |
| 32 virtual ~NotificationDelegate() {} | 26 virtual ~NotificationDelegate() {} |
| 33 }; | 27 }; |
| 34 | 28 |
| 35 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_DELEGATE_H_ | 29 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_DELEGATE_H_ |
| OLD | NEW |