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

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: 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
« no previous file with comments | « chrome/browser/ssl/ssl_blocking_page.h ('k') | chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..e185cc16b59b3226a98c73b340ca442a52a81b32 100644
--- a/chrome/browser/ssl/ssl_blocking_page.cc
+++ b/chrome/browser/ssl/ssl_blocking_page.cc
@@ -222,6 +222,7 @@ void RecordSSLBlockingPageDetailedStats(
// No error happening loading a sub-resource triggers an interstitial so far.
SSLBlockingPage::SSLBlockingPage(
content::WebContents* web_contents,
+ bool create_interstitial,
int cert_error,
const net::SSLInfo& ssl_info,
const GURL& request_url,
@@ -278,9 +279,15 @@ SSLBlockingPage::SSLBlockingPage(
content::Source<Profile>(profile));
#endif
- interstitial_page_ = InterstitialPage::Create(
- web_contents_, true, request_url, this);
- interstitial_page_->Show();
+ // 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.
+ if (create_interstitial) {
+ interstitial_page_ = InterstitialPage::Create(
+ web_contents_, true, request_url, this);
+ interstitial_page_->Show();
+ }
}
SSLBlockingPage::~SSLBlockingPage() {
@@ -300,6 +307,44 @@ 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) {
+ // The interstitial created by the blocking page owns the blocking page.
+ new SSLBlockingPage(web_contents,
+ true,
Bernhard Bauer 2014/07/16 21:49:59 What I meant was that you could show it from here,
meacer 2014/07/17 21:24:09 Done.
+ cert_error,
+ ssl_info,
+ request_url,
+ overridable,
+ strict_enforcement,
+ callback);
+}
+
+// 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) {
+ // The callee owns the blocking page.
Bernhard Bauer 2014/07/16 21:49:59 This comment would be better off in the header. Bu
meacer 2014/07/17 21:24:09 Returning scoped_ptr makes the code slightly more
+ return new SSLBlockingPage(web_contents,
+ false,
+ 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();
« no previous file with comments | « chrome/browser/ssl/ssl_blocking_page.h ('k') | chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698