Commit 6d3d62d3 authored by Nate Fischer's avatar Nate Fischer Committed by Commit Bot

AW: back-to-safety navigates backward for subresource

Clicking back-to-safety will now navigate backward for the malicious
subresource case, which is consistent with Chrome's behavior.

This removes is_resource_cancellable, since it was only added for the
old WebView behavior (see crrev/458833).

BUG=699196

Change-Id: Idb78f514f3ccbc8d899622c3700d71c93fdc7253
Reviewed-on: https://chromium-review.googlesource.com/516803Reviewed-by: default avatarJialiu Lin <jialiul@chromium.org>
Reviewed-by: default avatarAdrienne Porter Felt <felt@chromium.org>
Reviewed-by: default avatarSelim Gurun <sgurun@chromium.org>
Commit-Queue: Nate Fischer <ntfschr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#476510}
parent 7fd1b842
...@@ -72,7 +72,6 @@ void AwSafeBrowsingBlockingPage::ShowBlockingPage( ...@@ -72,7 +72,6 @@ void AwSafeBrowsingBlockingPage::ShowBlockingPage(
false, // is_extended_reporting false, // is_extended_reporting
false, // is_scout false, // is_scout
false, // kSafeBrowsingProceedAnywayDisabled false, // kSafeBrowsingProceedAnywayDisabled
true, // is_resource_cancellable
"cpn_safe_browsing_wv"); // help_center_article_link "cpn_safe_browsing_wv"); // help_center_article_link
ErrorUiType errorType = ErrorUiType errorType =
......
...@@ -78,7 +78,6 @@ class SafeBrowsingBlockingPageFactoryImpl ...@@ -78,7 +78,6 @@ class SafeBrowsingBlockingPageFactoryImpl
web_contents->GetBrowserContext()->IsOffTheRecord(), web_contents->GetBrowserContext()->IsOffTheRecord(),
IsExtendedReportingEnabled(*prefs), IsScout(*prefs), IsExtendedReportingEnabled(*prefs), IsScout(*prefs),
is_proceed_anyway_disabled, is_proceed_anyway_disabled,
BaseBlockingPage::IsMainPageLoadBlocked(unsafe_resources),
kHelpCenterLink); kHelpCenterLink);
return new SafeBrowsingBlockingPage(ui_manager, web_contents, return new SafeBrowsingBlockingPage(ui_manager, web_contents,
......
...@@ -317,7 +317,6 @@ class TestSafeBrowsingBlockingPageFactory ...@@ -317,7 +317,6 @@ class TestSafeBrowsingBlockingPageFactory
web_contents->GetBrowserContext()->IsOffTheRecord(), web_contents->GetBrowserContext()->IsOffTheRecord(),
IsExtendedReportingEnabled(*prefs), IsScout(*prefs), IsExtendedReportingEnabled(*prefs), IsScout(*prefs),
is_proceed_anyway_disabled, is_proceed_anyway_disabled,
BaseBlockingPage::IsMainPageLoadBlocked(unsafe_resources),
"cpn_safe_browsing" /* help_center_article_link */); "cpn_safe_browsing" /* help_center_article_link */);
return new TestSafeBrowsingBlockingPage(delegate, web_contents, return new TestSafeBrowsingBlockingPage(delegate, web_contents,
main_frame_url, unsafe_resources, main_frame_url, unsafe_resources,
......
...@@ -92,7 +92,6 @@ class TestSafeBrowsingBlockingPageFactory ...@@ -92,7 +92,6 @@ class TestSafeBrowsingBlockingPageFactory
web_contents->GetBrowserContext()->IsOffTheRecord(), web_contents->GetBrowserContext()->IsOffTheRecord(),
IsExtendedReportingEnabled(*prefs), IsScout(*prefs), IsExtendedReportingEnabled(*prefs), IsScout(*prefs),
is_proceed_anyway_disabled, is_proceed_anyway_disabled,
BaseBlockingPage::IsMainPageLoadBlocked(unsafe_resources),
"cpn_safe_browsing" /* help_center_article_link */); "cpn_safe_browsing" /* help_center_article_link */);
return new TestSafeBrowsingBlockingPage(manager, web_contents, return new TestSafeBrowsingBlockingPage(manager, web_contents,
main_frame_url, unsafe_resources, main_frame_url, unsafe_resources,
...@@ -174,7 +173,6 @@ class TestSafeBrowsingBlockingQuietPageFactory ...@@ -174,7 +173,6 @@ class TestSafeBrowsingBlockingQuietPageFactory
web_contents->GetBrowserContext()->IsOffTheRecord(), web_contents->GetBrowserContext()->IsOffTheRecord(),
IsExtendedReportingEnabled(*prefs), IsScout(*prefs), IsExtendedReportingEnabled(*prefs), IsScout(*prefs),
is_proceed_anyway_disabled, is_proceed_anyway_disabled,
BaseBlockingPage::IsMainPageLoadBlocked(unsafe_resources),
"cpn_safe_browsing" /* help_center_article_link */); "cpn_safe_browsing" /* help_center_article_link */);
return new TestSafeBrowsingBlockingPageQuiet( return new TestSafeBrowsingBlockingPageQuiet(
manager, web_contents, main_frame_url, unsafe_resources, manager, web_contents, main_frame_url, unsafe_resources,
......
...@@ -351,7 +351,6 @@ class TestSafeBrowsingBlockingPage : public SafeBrowsingBlockingPage { ...@@ -351,7 +351,6 @@ class TestSafeBrowsingBlockingPage : public SafeBrowsingBlockingPage {
false, // is_extended_reporting_enabled false, // is_extended_reporting_enabled
false, // is_scout_reporting_enabled false, // is_scout_reporting_enabled
false, // is_proceed_anyway_disabled false, // is_proceed_anyway_disabled
BaseBlockingPage::IsMainPageLoadBlocked(unsafe_resources),
"cpn_safe_browsing")) { // help_center_article_link "cpn_safe_browsing")) { // help_center_article_link
// Don't delay details at all for the unittest. // Don't delay details at all for the unittest.
SetThreatDetailsProceedDelayForTesting(0); SetThreatDetailsProceedDelayForTesting(0);
......
...@@ -79,7 +79,6 @@ BaseBlockingPage::CreateDefaultDisplayOptions( ...@@ -79,7 +79,6 @@ BaseBlockingPage::CreateDefaultDisplayOptions(
false, // is_extended_reporting false, // is_extended_reporting
false, // is_scout false, // is_scout
false, // kSafeBrowsingProceedAnywayDisabled false, // kSafeBrowsingProceedAnywayDisabled
true, // is_resource_cancellable
"cpn_safe_browsing"); // help_center_article_link "cpn_safe_browsing"); // help_center_article_link
} }
......
...@@ -31,7 +31,6 @@ BaseSafeBrowsingErrorUI::SBErrorDisplayOptions::SBErrorDisplayOptions( ...@@ -31,7 +31,6 @@ BaseSafeBrowsingErrorUI::SBErrorDisplayOptions::SBErrorDisplayOptions(
bool is_extended_reporting_enabled, bool is_extended_reporting_enabled,
bool is_scout_reporting_enabled, bool is_scout_reporting_enabled,
bool is_proceed_anyway_disabled, bool is_proceed_anyway_disabled,
bool is_resource_cancellable,
const std::string& help_center_article_link) const std::string& help_center_article_link)
: is_main_frame_load_blocked(is_main_frame_load_blocked), : is_main_frame_load_blocked(is_main_frame_load_blocked),
is_extended_reporting_opt_in_allowed( is_extended_reporting_opt_in_allowed(
...@@ -40,7 +39,6 @@ BaseSafeBrowsingErrorUI::SBErrorDisplayOptions::SBErrorDisplayOptions( ...@@ -40,7 +39,6 @@ BaseSafeBrowsingErrorUI::SBErrorDisplayOptions::SBErrorDisplayOptions(
is_extended_reporting_enabled(is_extended_reporting_enabled), is_extended_reporting_enabled(is_extended_reporting_enabled),
is_scout_reporting_enabled(is_scout_reporting_enabled), is_scout_reporting_enabled(is_scout_reporting_enabled),
is_proceed_anyway_disabled(is_proceed_anyway_disabled), is_proceed_anyway_disabled(is_proceed_anyway_disabled),
is_resource_cancellable(is_resource_cancellable),
help_center_article_link(help_center_article_link) {} help_center_article_link(help_center_article_link) {}
BaseSafeBrowsingErrorUI::SBErrorDisplayOptions::SBErrorDisplayOptions( BaseSafeBrowsingErrorUI::SBErrorDisplayOptions::SBErrorDisplayOptions(
...@@ -52,7 +50,6 @@ BaseSafeBrowsingErrorUI::SBErrorDisplayOptions::SBErrorDisplayOptions( ...@@ -52,7 +50,6 @@ BaseSafeBrowsingErrorUI::SBErrorDisplayOptions::SBErrorDisplayOptions(
is_extended_reporting_enabled(other.is_extended_reporting_enabled), is_extended_reporting_enabled(other.is_extended_reporting_enabled),
is_scout_reporting_enabled(other.is_scout_reporting_enabled), is_scout_reporting_enabled(other.is_scout_reporting_enabled),
is_proceed_anyway_disabled(other.is_proceed_anyway_disabled), is_proceed_anyway_disabled(other.is_proceed_anyway_disabled),
is_resource_cancellable(other.is_resource_cancellable),
help_center_article_link(other.help_center_article_link) {} help_center_article_link(other.help_center_article_link) {}
} // security_interstitials } // security_interstitials
...@@ -32,7 +32,6 @@ class BaseSafeBrowsingErrorUI { ...@@ -32,7 +32,6 @@ class BaseSafeBrowsingErrorUI {
bool is_extended_reporting_enabled, bool is_extended_reporting_enabled,
bool is_scout_reporting_enabled, bool is_scout_reporting_enabled,
bool is_proceed_anyway_disabled, bool is_proceed_anyway_disabled,
bool is_resource_cancellable,
const std::string& help_center_article_link); const std::string& help_center_article_link);
SBErrorDisplayOptions(const SBErrorDisplayOptions& other); SBErrorDisplayOptions(const SBErrorDisplayOptions& other);
...@@ -55,10 +54,6 @@ class BaseSafeBrowsingErrorUI { ...@@ -55,10 +54,6 @@ class BaseSafeBrowsingErrorUI {
// Indicates if kSafeBrowsingProceedAnywayDisabled preference is set. // Indicates if kSafeBrowsingProceedAnywayDisabled preference is set.
bool is_proceed_anyway_disabled; bool is_proceed_anyway_disabled;
// Indicates if "back to safety" should cancel the pending navigation or
// navigate back after it's committed.
bool is_resource_cancellable;
// The p= query parameter used when visiting the Help Center. If this is // The p= query parameter used when visiting the Help Center. If this is
// nullptr, then a default value will be used for the SafeBrowsing article. // nullptr, then a default value will be used for the SafeBrowsing article.
std::string help_center_article_link; std::string help_center_article_link;
...@@ -100,10 +95,6 @@ class BaseSafeBrowsingErrorUI { ...@@ -100,10 +95,6 @@ class BaseSafeBrowsingErrorUI {
return display_options_.is_proceed_anyway_disabled; return display_options_.is_proceed_anyway_disabled;
} }
bool is_resource_cancellable() const {
return display_options_.is_resource_cancellable;
}
const std::string& get_help_center_article_link() const { const std::string& get_help_center_article_link() const {
return display_options_.help_center_article_link; return display_options_.help_center_article_link;
} }
......
...@@ -130,7 +130,7 @@ void SafeBrowsingLoudErrorUI::HandleCommand( ...@@ -130,7 +130,7 @@ void SafeBrowsingLoudErrorUI::HandleCommand(
// User pressed on the button to return to safety. // User pressed on the button to return to safety.
// Don't record the user action here because there are other ways of // Don't record the user action here because there are other ways of
// triggering DontProceed, like clicking the back button. // triggering DontProceed, like clicking the back button.
if (is_resource_cancellable()) { if (is_main_frame_load_blocked()) {
// If the load is blocked, we want to close the interstitial and discard // If the load is blocked, we want to close the interstitial and discard
// the pending entry. // the pending entry.
controller()->GoBack(); controller()->GoBack();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment