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

Unified Diff: content/public/test/download_test_observer.h

Issue 1784433003: Track CTR of uncommon download warning. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nit Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: content/public/test/download_test_observer.h
diff --git a/content/public/test/download_test_observer.h b/content/public/test/download_test_observer.h
index c7e209588dd7dcfeb3a034d2794252289bf611cb..42e018e092152d55c701f863551233d1801b2b78 100644
--- a/content/public/test/download_test_observer.h
+++ b/content/public/test/download_test_observer.h
@@ -97,6 +97,12 @@ class DownloadTestObserver : public DownloadManager::Observer,
size_t NumDownloadsSeenInState(DownloadItem::DownloadState state) const;
+ DownloadManager* download_manager();
+
+ DangerousDownloadAction dangerous_download_action();
+
+ std::set<uint32_t>& dangerous_downloads_seen();
+
protected:
// Only to be called by derived classes' constructors.
virtual void Init();
@@ -104,18 +110,18 @@ class DownloadTestObserver : public DownloadManager::Observer,
// Called to see if a download item is in a final state.
virtual bool IsDownloadInFinalState(DownloadItem* download) = 0;
- private:
- typedef std::set<DownloadItem*> DownloadSet;
-
- // Maps states to the number of times they have been encountered
- typedef std::map<DownloadItem::DownloadState, size_t> StateMap;
-
// Called when we know that a download item is in a final state.
// Note that this is not the same as it first transitioning in to the
// final state; multiple notifications may occur once the item is in
// that state. So we keep our own track of transitions into final.
void DownloadInFinalState(DownloadItem* download);
+ private:
+ typedef std::set<DownloadItem*> DownloadSet;
+
+ // Maps states to the number of times they have been encountered
+ typedef std::map<DownloadItem::DownloadState, size_t> StateMap;
+
void SignalIfFinished();
// Fake user click on "Accept".
@@ -182,7 +188,7 @@ class DownloadTestObserverTerminal : public DownloadTestObserver {
~DownloadTestObserverTerminal() override;
- private:
+ protected:
bool IsDownloadInFinalState(DownloadItem* download) override;
DISALLOW_COPY_AND_ASSIGN(DownloadTestObserverTerminal);

Powered by Google App Engine
This is Rietveld 408576698