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

Unified Diff: chrome/browser/safe_browsing/safe_browsing_blocking_page.h

Issue 1509073002: Fixes for Safe Browsing with unrelated pending navigations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years 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/safe_browsing/safe_browsing_blocking_page.h
diff --git a/chrome/browser/safe_browsing/safe_browsing_blocking_page.h b/chrome/browser/safe_browsing/safe_browsing_blocking_page.h
index 8c8e6989198803fd015ab6889933404e86050e4b..2f8ba151dc93ed91921c05bc3d589902ffa046a3 100644
--- a/chrome/browser/safe_browsing/safe_browsing_blocking_page.h
+++ b/chrome/browser/safe_browsing/safe_browsing_blocking_page.h
@@ -65,7 +65,8 @@ class SafeBrowsingBlockingPage : public SecurityInterstitialPage {
static SafeBrowsingBlockingPage* CreateBlockingPage(
SafeBrowsingUIManager* ui_manager,
content::WebContents* web_contents,
- const UnsafeResource& unsafe_resource);
+ const UnsafeResource& unsafe_resource,
+ const GURL& main_frame_url);
// Shows a blocking page warning the user about phishing/malware for a
// specific resource.
@@ -95,13 +96,32 @@ class SafeBrowsingBlockingPage : public SecurityInterstitialPage {
friend class SafeBrowsingBlockingPageTest;
FRIEND_TEST_ALL_PREFIXES(SafeBrowsingBlockingPageTest,
ProceedThenDontProceed);
+ FRIEND_TEST_ALL_PREFIXES(SafeBrowsingBlockingPageTest,
+ MalwareReportsDisabled);
+ FRIEND_TEST_ALL_PREFIXES(SafeBrowsingBlockingPageTest,
+ MalwareReportsToggling);
+ FRIEND_TEST_ALL_PREFIXES(SafeBrowsingBlockingPageTest,
+ ExtendedReportingNotShownOnSecurePage);
+ FRIEND_TEST_ALL_PREFIXES(
+ SafeBrowsingBlockingPageTest,
+ ExtendedReportingNotShownOnSecurePageWithSecureSubresource);
+ FRIEND_TEST_ALL_PREFIXES(
+ SafeBrowsingBlockingPageTest,
+ ExtendedReportingNotShownOnSecurePageWithInsecureSubresource);
+ FRIEND_TEST_ALL_PREFIXES(
+ SafeBrowsingBlockingPageTest,
+ ExtendedReportingOnInsecurePageWithSecureSubresource);
+ FRIEND_TEST_ALL_PREFIXES(
+ SafeBrowsingBlockingPageTest,
+ ExtendedReportingNotShownOnSecurePageWithPendingInsecureLoad);
void UpdateReportingPref(); // Used for the transition from old to new pref.
// Don't instantiate this class directly, use ShowBlockingPage instead.
SafeBrowsingBlockingPage(SafeBrowsingUIManager* ui_manager,
content::WebContents* web_contents,
- const UnsafeResourceList& unsafe_resources);
+ const UnsafeResourceList& unsafe_resources,
+ const GURL& main_frame_url);
// SecurityInterstitialPage methods:
bool ShouldCreateNewNavigation() const override;
@@ -151,6 +171,9 @@ class SafeBrowsingBlockingPage : public SecurityInterstitialPage {
// finishes.
bool is_main_frame_load_blocked_;
+ // The URL of the main frame that caused the warning.
+ GURL main_frame_url_;
+
// The index of a navigation entry that should be removed when DontProceed()
// is invoked, -1 if not entry should be removed.
int navigation_entry_index_to_remove_;
@@ -201,7 +224,8 @@ class SafeBrowsingBlockingPageFactory {
virtual SafeBrowsingBlockingPage* CreateSafeBrowsingPage(
SafeBrowsingUIManager* ui_manager,
content::WebContents* web_contents,
- const SafeBrowsingBlockingPage::UnsafeResourceList& unsafe_resources) = 0;
+ const SafeBrowsingBlockingPage::UnsafeResourceList& unsafe_resources,
+ const GURL& main_frame_url) = 0;
};
} // namespace safe_browsing

Powered by Google App Engine
This is Rietveld 408576698