Index: chrome/browser/ui/views/download/download_item_view.h |
diff --git a/chrome/browser/ui/views/download/download_item_view.h b/chrome/browser/ui/views/download/download_item_view.h |
index df9dd8708f42d29a4c420d203be0860f2cbbb2da..d81d2f557dfb183e9f392ab8c9c405b0e8bf1154 100644 |
--- a/chrome/browser/ui/views/download/download_item_view.h |
+++ b/chrome/browser/ui/views/download/download_item_view.h |
@@ -25,6 +25,7 @@ |
#include "base/task/cancelable_task_tracker.h" |
#include "base/time/time.h" |
#include "base/timer/timer.h" |
+#include "chrome/browser/download/download_commands.h" |
#include "chrome/browser/download/download_item_model.h" |
#include "chrome/browser/icon_manager.h" |
#include "content/public/browser/download_item.h" |
@@ -84,6 +85,12 @@ class DownloadItemView : public views::InkDropHostView, |
// Returns the DownloadItem model object belonging to this item. |
content::DownloadItem* download() { return model_.download(); } |
+ // Submit download to download feedback service if the user has approved and |
Peter Kasting
2016/11/01 23:48:32
Nit: Verbs in function comments should be descript
Jialiu Lin
2016/11/03 20:16:50
Done.
|
+ // the download is suitable for submission, then apply |download_command|. |
+ // If user hasn't seen SBER opt-in text before, show SBER opt-in dialog first. |
Peter Kasting
2016/11/01 23:48:32
Does this function delete |this|? If so it should
Jialiu Lin
2016/11/03 20:16:50
Agree, I don't think it deletes |this|. Will fix c
|
+ void MaybeSubmitDownloadToFeedbackService( |
+ DownloadCommands::Command download_command); |
+ |
// DownloadItem::Observer methods |
void OnDownloadUpdated(content::DownloadItem* download) override; |
void OnDownloadOpened(content::DownloadItem* download) override; |
@@ -142,13 +149,16 @@ class DownloadItemView : public views::InkDropHostView, |
void OpenDownload(); |
// Submits the downloaded file to the safebrowsing download feedback service. |
- // Returns whether submission was successful. On successful submission, |
- // |this| and the DownloadItem will have been deleted. |
- bool SubmitDownloadToFeedbackService(); |
+ // Returns whether submission was successful. On successful submission, apply |
+ // |download_command|, and |this| will have been deleted. |
Peter Kasting
2016/11/01 23:48:32
This comment doesn't seem to accurately describe w
Jialiu Lin
2016/11/03 20:16:50
I agree. If the "make a temp copy" strategy works
|
+ bool SubmitDownloadToFeedbackService( |
+ DownloadCommands::Command download_command); |
// If the user has |enabled| uploading, calls SubmitDownloadToFeedbackService. |
- // Otherwise, it simply removes the DownloadItem without uploading. |
- void PossiblySubmitDownloadToFeedbackService(bool enabled); |
+ // Otherwise, apply |download_command|. |
+ void SubmitDownloadWhenFeedbackServiceEnabled( |
+ DownloadCommands::Command download_command, |
+ bool feedback_enabled); |
// This function calculates the vertical coordinate to draw the file name text |
// relative to local bounds. |