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

Unified Diff: chrome/browser/ui/views/download/download_item_view.h

Issue 2439533002: Download Feedback Service should upload all eligible downloads (Closed)
Patch Set: make windows bots happy Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
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 a0034a6d44868bc83b1db8301fe28eb69075125a..f0396ecb8b4e7a48a34cf04c7eea2b068d8e3e4f 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(); }
+ // Submits download to download feedback service if the user has approved and
+ // 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.
+ void MaybeSubmitDownloadToFeedbackService(
+ DownloadCommands::Command download_command);
+
// DownloadItem::Observer methods
void OnDownloadUpdated(content::DownloadItem* download) override;
void OnDownloadOpened(content::DownloadItem* download) override;
@@ -143,13 +150,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. Applies |download_command|, if
+ // submission fails.
+ 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.

Powered by Google App Engine
This is Rietveld 408576698