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 #ifndef CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_OBJECT_PROXY_H_ | 5 #ifndef CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_OBJECT_PROXY_H_ |
6 #define CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_OBJECT_PROXY_H_ | 6 #define CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_OBJECT_PROXY_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 // attached JS listeners will be invoked in the renderer or worker process. | 21 // attached JS listeners will be invoked in the renderer or worker process. |
22 class NotificationObjectProxy | 22 class NotificationObjectProxy |
23 : public NotificationDelegate { | 23 : public NotificationDelegate { |
24 public: | 24 public: |
25 // Creates a Proxy object with the necessary callback information. The Proxy | 25 // Creates a Proxy object with the necessary callback information. The Proxy |
26 // will take ownership of |delegate|. | 26 // will take ownership of |delegate|. |
27 NotificationObjectProxy( | 27 NotificationObjectProxy( |
28 scoped_ptr<content::DesktopNotificationDelegate> delegate); | 28 scoped_ptr<content::DesktopNotificationDelegate> delegate); |
29 | 29 |
30 // NotificationDelegate implementation. | 30 // NotificationDelegate implementation. |
31 virtual void Display() override; | 31 void Display() override; |
32 virtual void Error() override; | 32 void Error() override; |
33 virtual void Close(bool by_user) override; | 33 void Close(bool by_user) override; |
34 virtual void Click() override; | 34 void Click() override; |
35 virtual std::string id() const override; | 35 std::string id() const override; |
36 | 36 |
37 protected: | 37 protected: |
38 friend class base::RefCountedThreadSafe<NotificationObjectProxy>; | 38 friend class base::RefCountedThreadSafe<NotificationObjectProxy>; |
39 | 39 |
40 virtual ~NotificationObjectProxy(); | 40 ~NotificationObjectProxy() override; |
41 | 41 |
42 private: | 42 private: |
43 scoped_ptr<content::DesktopNotificationDelegate> delegate_; | 43 scoped_ptr<content::DesktopNotificationDelegate> delegate_; |
44 bool displayed_; | 44 bool displayed_; |
45 std::string id_; | 45 std::string id_; |
46 }; | 46 }; |
47 | 47 |
48 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_OBJECT_PROXY_H_ | 48 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_OBJECT_PROXY_H_ |
OLD | NEW |