| 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_ITEM_NOTIFICATION_H_ | 5 #ifndef CHROME_BROWSER_DOWNLOAD_NOTIFICATION_DOWNLOAD_ITEM_NOTIFICATION_H_ |
| 6 #define CHROME_BROWSER_DOWNLOAD_NOTIFICATION_DOWNLOAD_ITEM_NOTIFICATION_H_ | 6 #define CHROME_BROWSER_DOWNLOAD_NOTIFICATION_DOWNLOAD_ITEM_NOTIFICATION_H_ |
| 7 | 7 |
| 8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
| 9 #include "chrome/browser/download/download_commands.h" | 9 #include "chrome/browser/download/download_commands.h" |
| 10 #include "chrome/browser/download/notification/download_notification.h" | 10 #include "chrome/browser/download/notification/download_notification.h" |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 | 98 |
| 99 Browser* GetBrowser() const; | 99 Browser* GetBrowser() const; |
| 100 Profile* profile() const; | 100 Profile* profile() const; |
| 101 | 101 |
| 102 // Returns the list of possible extra (all except the default) actions. | 102 // Returns the list of possible extra (all except the default) actions. |
| 103 scoped_ptr<std::vector<DownloadCommands::Command>> GetExtraActions() const; | 103 scoped_ptr<std::vector<DownloadCommands::Command>> GetExtraActions() const; |
| 104 | 104 |
| 105 // Flag to show the notification on next update. If true, the notification | 105 // Flag to show the notification on next update. If true, the notification |
| 106 // goes visible. The initial value is true so it gets shown on initial update. | 106 // goes visible. The initial value is true so it gets shown on initial update. |
| 107 bool show_next_ = true; | 107 bool show_next_ = true; |
| 108 // Current vilibility status of the notification. |
| 109 bool visible_ = false; |
| 108 | 110 |
| 109 int image_resource_id_ = 0; | 111 int image_resource_id_ = 0; |
| 110 std::pair<gfx::VectorIconId, SkColor> vector_icon_params_; | 112 std::pair<gfx::VectorIconId, SkColor> vector_icon_params_; |
| 111 content::DownloadItem::DownloadState previous_download_state_ = | 113 content::DownloadItem::DownloadState previous_download_state_ = |
| 112 content::DownloadItem::MAX_DOWNLOAD_STATE; // As uninitialized state | 114 content::DownloadItem::MAX_DOWNLOAD_STATE; // As uninitialized state |
| 113 bool previous_dangerous_state_ = false; | 115 bool previous_dangerous_state_ = false; |
| 114 scoped_ptr<Notification> notification_; | 116 scoped_ptr<Notification> notification_; |
| 115 content::DownloadItem* item_; | 117 content::DownloadItem* item_; |
| 116 scoped_ptr<std::vector<DownloadCommands::Command>> button_actions_; | 118 scoped_ptr<std::vector<DownloadCommands::Command>> button_actions_; |
| 117 | 119 |
| 118 // Status of the preview image decode. | 120 // Status of the preview image decode. |
| 119 ImageDecodeStatus image_decode_status_ = NOT_STARTED; | 121 ImageDecodeStatus image_decode_status_ = NOT_STARTED; |
| 120 | 122 |
| 121 // Pointer to the message center instance. | |
| 122 message_center::MessageCenter* message_center_; | |
| 123 | |
| 124 void SetMessageCenterForTest( | |
| 125 message_center::MessageCenter* message_center); | |
| 126 | |
| 127 base::WeakPtrFactory<DownloadItemNotification> weak_factory_; | 123 base::WeakPtrFactory<DownloadItemNotification> weak_factory_; |
| 128 | 124 |
| 129 DISALLOW_COPY_AND_ASSIGN(DownloadItemNotification); | 125 DISALLOW_COPY_AND_ASSIGN(DownloadItemNotification); |
| 130 }; | 126 }; |
| 131 | 127 |
| 132 #endif // CHROME_BROWSER_DOWNLOAD_NOTIFICATION_DOWNLOAD_ITEM_NOTIFICATION_H_ | 128 #endif // CHROME_BROWSER_DOWNLOAD_NOTIFICATION_DOWNLOAD_ITEM_NOTIFICATION_H_ |
| OLD | NEW |