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

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

Issue 368143002: Add a chrome://interstitials page. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: bauerb comments Created 6 years, 5 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: chrome/browser/safe_browsing/safe_browsing_blocking_page.cc
diff --git a/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc b/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc
index 81c3f2a116fdd9cee692ebffd320a0c4f6fadf70..b7c658e1ec959a548b6651b96bd73f7374fa5d51 100644
--- a/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc
@@ -872,6 +872,20 @@ SafeBrowsingBlockingPage::UnsafeResourceMap*
}
// static
+SafeBrowsingBlockingPage* SafeBrowsingBlockingPage::CreateBlockingPage(
+ SafeBrowsingUIManager* ui_manager,
+ WebContents* web_contents,
+ const UnsafeResource& unsafe_resource) {
+ std::vector<UnsafeResource> resources;
+ resources.push_back(unsafe_resource);
+ // Set up the factory if this has not been done already (tests do that
+ // before this method is called).
+ if (!factory_)
+ factory_ = g_safe_browsing_blocking_page_factory_impl.Pointer();
+ return factory_->CreateSafeBrowsingPage(ui_manager, web_contents, resources);
+}
+
+// static
void SafeBrowsingBlockingPage::ShowBlockingPage(
SafeBrowsingUIManager* ui_manager,
const UnsafeResource& unsafe_resource) {
@@ -892,14 +906,8 @@ void SafeBrowsingBlockingPage::ShowBlockingPage(
if (!interstitial) {
// There are no interstitial currently showing in that tab, go ahead and
// show this interstitial.
- std::vector<UnsafeResource> resources;
- resources.push_back(unsafe_resource);
- // Set up the factory if this has not been done already (tests do that
- // before this method is called).
- if (!factory_)
- factory_ = g_safe_browsing_blocking_page_factory_impl.Pointer();
SafeBrowsingBlockingPage* blocking_page =
- factory_->CreateSafeBrowsingPage(ui_manager, web_contents, resources);
+ CreateBlockingPage(ui_manager, web_contents, unsafe_resource);
blocking_page->interstitial_page_->Show();
return;
}

Powered by Google App Engine
This is Rietveld 408576698