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

Unified Diff: components/safe_browsing/base_blocking_page.h

Issue 2700323002: Refactor BaseBlockingPage to reduce duplicated code (Closed)
Patch Set: Created 3 years, 10 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
« no previous file with comments | « chrome/browser/safe_browsing/ui_manager_unittest.cc ('k') | components/safe_browsing/base_blocking_page.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/safe_browsing/base_blocking_page.h
diff --git a/components/safe_browsing/base_blocking_page.h b/components/safe_browsing/base_blocking_page.h
index f1cb3a90ecfa3e2c6505dc7cc150df23da9ac8a6..436745a329218adfdf6ef298edbaaad0e3fe4e5e 100644
--- a/components/safe_browsing/base_blocking_page.h
+++ b/components/safe_browsing/base_blocking_page.h
@@ -12,14 +12,11 @@
#include "base/macros.h"
#include "components/safe_browsing/base_ui_manager.h"
#include "components/security_interstitials/content/security_interstitial_page.h"
+#include "components/security_interstitials/core/metrics_helper.h"
#include "components/security_interstitials/core/safe_browsing_error_ui.h"
#include "content/public/browser/interstitial_page_delegate.h"
#include "url/gurl.h"
-namespace history {
-class HistoryService;
-}
-
namespace safe_browsing {
// Base class for managing the SafeBrowsing interstitial pages.
@@ -104,14 +101,21 @@ class BaseBlockingPage
void set_proceeded(bool proceeded);
+ static security_interstitials::MetricsHelper::ReportDetails GetReportingInfo(
+ const UnsafeResourceList& unsafe_resources);
+
+ // Called after OnProceed(). Does nothing in this class, but can be overridden
+ // to handle malicious subresources.
+ virtual void HandleSubresourcesAfterProceed();
+
+ void SetThreatDetailsProceedDelayForTesting(int64_t delay);
+
private:
static std::unique_ptr<
security_interstitials::SecurityInterstitialControllerClient>
CreateControllerClient(content::WebContents* web_contents,
const UnsafeResourceList& unsafe_resources,
- history::HistoryService* history_service,
- const std::string& app_locale,
- const GURL& default_safe_page);
+ BaseUIManager* ui_manager);
// For reporting back user actions.
BaseUIManager* ui_manager_;
@@ -132,6 +136,12 @@ class BaseBlockingPage
// Indicate whether user has proceeded this blocking page.
bool proceeded_;
+ // After a safe browsing interstitial where the user opted-in to the
+ // report but clicked "proceed anyway", we delay the call to
+ // ThreatDetails::FinishCollection() by this much time (in
+ // milliseconds), in order to get data from the blocked resource itself.
+ int64_t threat_details_proceed_delay_ms_;
+
DISALLOW_COPY_AND_ASSIGN(BaseBlockingPage);
};
« no previous file with comments | « chrome/browser/safe_browsing/ui_manager_unittest.cc ('k') | components/safe_browsing/base_blocking_page.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698