OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_DOWNLOAD_NOTIFICATION_DOWNLOAD_NOTIFICATION_ITEM_H_ | 5 #ifndef CHROME_BROWSER_DOWNLOAD_NOTIFICATION_DOWNLOAD_NOTIFICATION_ITEM_H_ |
6 #define CHROME_BROWSER_DOWNLOAD_NOTIFICATION_DOWNLOAD_NOTIFICATION_ITEM_H_ | 6 #define CHROME_BROWSER_DOWNLOAD_NOTIFICATION_DOWNLOAD_NOTIFICATION_ITEM_H_ |
7 | 7 |
8 #include "chrome/browser/download/notification/download_notification_item.h" | 8 #include "chrome/browser/download/notification/download_notification_item.h" |
9 | 9 |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 | 24 |
25 class DownloadNotificationItem : public content::DownloadItem::Observer { | 25 class DownloadNotificationItem : public content::DownloadItem::Observer { |
26 public: | 26 public: |
27 class Delegate { | 27 class Delegate { |
28 public: | 28 public: |
29 virtual void OnDownloadStarted(DownloadNotificationItem* item) = 0; | 29 virtual void OnDownloadStarted(DownloadNotificationItem* item) = 0; |
30 virtual void OnDownloadStopped(DownloadNotificationItem* item) = 0; | 30 virtual void OnDownloadStopped(DownloadNotificationItem* item) = 0; |
31 virtual void OnDownloadRemoved(DownloadNotificationItem* item) = 0; | 31 virtual void OnDownloadRemoved(DownloadNotificationItem* item) = 0; |
32 }; | 32 }; |
33 | 33 |
34 DownloadNotificationItem(content::DownloadItem* item, Delegate* delegate); | 34 DownloadNotificationItem( |
| 35 content::DownloadItem* item, Profile* profile, Delegate* delegate); |
35 | 36 |
36 ~DownloadNotificationItem() override; | 37 ~DownloadNotificationItem() override; |
37 | 38 |
38 private: | 39 private: |
39 class NotificationWatcher : public message_center::NotificationDelegate, | 40 class NotificationWatcher : public message_center::NotificationDelegate, |
40 public message_center::MessageCenterObserver { | 41 public message_center::MessageCenterObserver { |
41 public: | 42 public: |
42 explicit NotificationWatcher(DownloadNotificationItem* item); | 43 explicit NotificationWatcher(DownloadNotificationItem* item); |
43 | 44 |
44 private: | 45 private: |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 scoped_ptr<std::vector<DownloadCommands::Command>> button_actions_; | 96 scoped_ptr<std::vector<DownloadCommands::Command>> button_actions_; |
96 | 97 |
97 Delegate* const delegate_; | 98 Delegate* const delegate_; |
98 | 99 |
99 friend class test::DownloadNotificationItemTest; | 100 friend class test::DownloadNotificationItemTest; |
100 | 101 |
101 DISALLOW_COPY_AND_ASSIGN(DownloadNotificationItem); | 102 DISALLOW_COPY_AND_ASSIGN(DownloadNotificationItem); |
102 }; | 103 }; |
103 | 104 |
104 #endif // CHROME_BROWSER_DOWNLOAD_NOTIFICATION_DOWNLOAD_NOTIFICATION_ITEM_H_ | 105 #endif // CHROME_BROWSER_DOWNLOAD_NOTIFICATION_DOWNLOAD_NOTIFICATION_ITEM_H_ |
OLD | NEW |