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

Unified Diff: chrome/browser/ssl/ssl_blocking_page.cc

Issue 368143002: Add a chrome://interstitials page. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix client side phishing interstitial 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/ssl/ssl_blocking_page.cc
diff --git a/chrome/browser/ssl/ssl_blocking_page.cc b/chrome/browser/ssl/ssl_blocking_page.cc
index ca97c2b60a0a90009235bd3716fc0b3b657f2126..f7bc5a509e00269e895b9172c802964af9aa56b6 100644
--- a/chrome/browser/ssl/ssl_blocking_page.cc
+++ b/chrome/browser/ssl/ssl_blocking_page.cc
@@ -278,9 +278,12 @@ SSLBlockingPage::SSLBlockingPage(
content::Source<Profile>(profile));
#endif
+ // chrome://interstitials page uses this class without actually creating an
+ // interstitial so that it can be debugged. Set |create_interstitial| to true
+ // if the page is going to be used as an actual interstitial and not just part
+ // of the chrome://interstitials webui.
interstitial_page_ = InterstitialPage::Create(
web_contents_, true, request_url, this);
- interstitial_page_->Show();
}
SSLBlockingPage::~SSLBlockingPage() {
@@ -300,6 +303,41 @@ SSLBlockingPage::~SSLBlockingPage() {
}
}
+// static
+void SSLBlockingPage::Show(content::WebContents* web_contents,
+ int cert_error,
+ const net::SSLInfo& ssl_info,
+ const GURL& request_url,
+ bool overridable,
+ bool strict_enforcement,
+ const base::Callback<void(bool)>& callback) {
+ SSLBlockingPage* ssl_blocking_page = new SSLBlockingPage(web_contents,
+ cert_error,
+ ssl_info,
+ request_url,
+ overridable,
+ strict_enforcement,
+ callback);
+ ssl_blocking_page->interstitial_page_->Show();
+}
+
+// static
+SSLBlockingPage* SSLBlockingPage::CreateForWebUI(
+ content::WebContents* web_contents,
+ int cert_error,
+ const net::SSLInfo& ssl_info,
+ const GURL& request_url,
+ bool overridable,
+ bool strict_enforcement) {
+ return new SSLBlockingPage(web_contents,
+ cert_error,
+ ssl_info,
+ request_url,
+ overridable,
+ strict_enforcement,
+ base::Callback<void(bool)>());
+}
+
std::string SSLBlockingPage::GetHTMLContents() {
if (trial_condition_ == kCondV1 || trial_condition_ == kCondV1LayoutV2Text)
return GetHTMLContentsV1();

Powered by Google App Engine
This is Rietveld 408576698