Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(380)

Side by Side Diff: chrome/browser/download/notification/download_notification_item.h

Issue 1105953002: Pop up the notification when the download is interrupted or completed (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@dn-xxxx-close-bug
Patch Set: Adressed comment and pop up the notification after completion Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 scoped_ptr<std::vector<DownloadCommands::Command>> GetPossibleActions() const; 103 scoped_ptr<std::vector<DownloadCommands::Command>> GetPossibleActions() const;
103 104
104 bool openable_; 105 bool openable_;
105 bool downloading_; 106 content::DownloadItem::DownloadState previous_download_state_ =
107 content::DownloadItem::MAX_DOWNLOAD_STATE; // As uninitialized state
106 int image_resource_id_; 108 int image_resource_id_;
107 Profile* profile_; 109 Profile* profile_;
108 scoped_refptr<NotificationWatcher> watcher_; 110 scoped_refptr<NotificationWatcher> watcher_;
109 111
110 scoped_ptr<Notification> notification_; 112 scoped_ptr<Notification> notification_;
111 113
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 116
115 Delegate* const delegate_; 117 Delegate* const delegate_;
116 118
117 DISALLOW_COPY_AND_ASSIGN(DownloadNotificationItem); 119 DISALLOW_COPY_AND_ASSIGN(DownloadNotificationItem);
118 }; 120 };
119 121
120 #endif // CHROME_BROWSER_DOWNLOAD_NOTIFICATION_DOWNLOAD_NOTIFICATION_ITEM_H_ 122 #endif // CHROME_BROWSER_DOWNLOAD_NOTIFICATION_DOWNLOAD_NOTIFICATION_ITEM_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698