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

Unified Diff: android_webview/browser/aw_safe_browsing_blocking_page.cc

Issue 2898593002: WebView: choose loud vs. quiet interstitial (Closed)
Patch Set: Update WebView test for behavior change Created 3 years, 7 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: android_webview/browser/aw_safe_browsing_blocking_page.cc
diff --git a/android_webview/browser/aw_safe_browsing_blocking_page.cc b/android_webview/browser/aw_safe_browsing_blocking_page.cc
index b91adb791d7930ea67c9bd00c9501647096a12da..01e426b2d9c49f34eaf40160bb27487556cb946f 100644
--- a/android_webview/browser/aw_safe_browsing_blocking_page.cc
+++ b/android_webview/browser/aw_safe_browsing_blocking_page.cc
@@ -25,13 +25,15 @@ AwSafeBrowsingBlockingPage::AwSafeBrowsingBlockingPage(
const GURL& main_frame_url,
const UnsafeResourceList& unsafe_resources,
std::unique_ptr<SecurityInterstitialControllerClient> controller_client,
- const BaseSafeBrowsingErrorUI::SBErrorDisplayOptions& display_options)
+ const BaseSafeBrowsingErrorUI::SBErrorDisplayOptions& display_options,
+ ErrorUiType errorType)
: BaseBlockingPage(ui_manager,
web_contents,
main_frame_url,
unsafe_resources,
std::move(controller_client),
- display_options) {}
+ display_options,
+ errorType) {}
// static
void AwSafeBrowsingBlockingPage::ShowBlockingPage(
@@ -61,11 +63,21 @@ void AwSafeBrowsingBlockingPage::ShowBlockingPage(
false, // is_scout
false, // kSafeBrowsingProceedAnywayDisabled
true); // is_resource_cancellable
+
+ ErrorUiType errorType;
+ if (ui_manager->IsLoud(unsafe_resource)) {
+ errorType = ErrorUiType::LOUD;
+ } else if (ui_manager->IsGiant(unsafe_resource)) {
+ errorType = ErrorUiType::QUIET_GIANT;
+ } else {
+ errorType = ErrorUiType::QUIET_SMALL;
+ }
+
AwSafeBrowsingBlockingPage* blocking_page = new AwSafeBrowsingBlockingPage(
ui_manager, web_contents, entry ? entry->GetURL() : GURL(),
unsafe_resources,
CreateControllerClient(web_contents, unsafe_resources, ui_manager),
- display_options);
+ display_options, errorType);
blocking_page->Show();
}
}

Powered by Google App Engine
This is Rietveld 408576698