| 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 void OnNotificationClick(); | 77 void OnNotificationClick(); |
| 78 void OnNotificationButtonClick(int button_index); | 78 void OnNotificationButtonClick(int button_index); |
| 79 | 79 |
| 80 // DownloadItem::Observer overrides: | 80 // DownloadItem::Observer overrides: |
| 81 void OnDownloadUpdated(content::DownloadItem* item) override; | 81 void OnDownloadUpdated(content::DownloadItem* item) override; |
| 82 void OnDownloadOpened(content::DownloadItem* item) override; | 82 void OnDownloadOpened(content::DownloadItem* item) override; |
| 83 void OnDownloadRemoved(content::DownloadItem* item) override; | 83 void OnDownloadRemoved(content::DownloadItem* item) override; |
| 84 void OnDownloadDestroyed(content::DownloadItem* item) override; | 84 void OnDownloadDestroyed(content::DownloadItem* item) override; |
| 85 | 85 |
| 86 void CloseNotificationByUser(); | 86 void CloseNotificationByUser(); |
| 87 void CloseNotificationByNonUser(); |
| 87 void UpdateNotificationData(NotificationUpdateType type); | 88 void UpdateNotificationData(NotificationUpdateType type); |
| 88 void SetNotificationImage(int resource_id); | 89 void SetNotificationImage(int resource_id); |
| 89 | 90 |
| 90 NotificationUIManager* notification_ui_manager() const; | 91 NotificationUIManager* notification_ui_manager() const; |
| 91 | 92 |
| 92 // Returns a short one-line status string for the download. | 93 // Returns a short one-line status string for the download. |
| 93 base::string16 GetTitle() const; | 94 base::string16 GetTitle() const; |
| 94 | 95 |
| 95 // Returns a short one-line status string for a download command. | 96 // Returns a short one-line status string for a download command. |
| 96 base::string16 GetCommandLabel(DownloadCommands::Command command) const; | 97 base::string16 GetCommandLabel(DownloadCommands::Command command) const; |
| 97 | 98 |
| 98 // Get the warning test to notify a dangerous download. Should only be called | 99 // Get the warning test to notify a dangerous download. Should only be called |
| 99 // if IsDangerous() is true. | 100 // if IsDangerous() is true. |
| 100 base::string16 GetWarningText() const; | 101 base::string16 GetWarningText() const; |
| 101 | 102 |
| 102 Browser* GetBrowser(); | 103 Browser* GetBrowser(); |
| 103 | 104 |
| 104 scoped_ptr<std::vector<DownloadCommands::Command>> GetPossibleActions() const; | 105 scoped_ptr<std::vector<DownloadCommands::Command>> GetPossibleActions() const; |
| 105 | 106 |
| 106 bool openable_ = false; | 107 bool openable_ = false; |
| 107 bool downloading_ = false; | |
| 108 int image_resource_id_ = 0; | 108 int image_resource_id_ = 0; |
| 109 content::DownloadItem::DownloadState previous_download_state_ = |
| 110 content::DownloadItem::MAX_DOWNLOAD_STATE; // As uninitialized state |
| 109 Profile* profile_; | 111 Profile* profile_; |
| 110 scoped_refptr<NotificationWatcher> watcher_; | 112 scoped_refptr<NotificationWatcher> watcher_; |
| 111 scoped_ptr<Notification> notification_; | 113 scoped_ptr<Notification> notification_; |
| 112 content::DownloadItem* item_; | 114 content::DownloadItem* item_; |
| 113 scoped_ptr<std::vector<DownloadCommands::Command>> button_actions_; | 115 scoped_ptr<std::vector<DownloadCommands::Command>> button_actions_; |
| 114 Delegate* const delegate_; | 116 Delegate* const delegate_; |
| 115 | 117 |
| 116 DISALLOW_COPY_AND_ASSIGN(DownloadNotificationItem); | 118 DISALLOW_COPY_AND_ASSIGN(DownloadNotificationItem); |
| 117 }; | 119 }; |
| 118 | 120 |
| 119 #endif // CHROME_BROWSER_DOWNLOAD_NOTIFICATION_DOWNLOAD_NOTIFICATION_ITEM_H_ | 121 #endif // CHROME_BROWSER_DOWNLOAD_NOTIFICATION_DOWNLOAD_NOTIFICATION_ITEM_H_ |
| OLD | NEW |