Chromium Code Reviews| Index: chrome/browser/ui/webui/interstitials/interstitial_ui.cc |
| diff --git a/chrome/browser/ui/webui/interstitials/interstitial_ui.cc b/chrome/browser/ui/webui/interstitials/interstitial_ui.cc |
| index 6bdd42fe0cf6259fcb9ab08ec018770cdc0eea26..b142588f410c2cf81418999cbca744f60d4e38ee 100644 |
| --- a/chrome/browser/ui/webui/interstitials/interstitial_ui.cc |
| +++ b/chrome/browser/ui/webui/interstitials/interstitial_ui.cc |
| @@ -51,6 +51,8 @@ SSLBlockingPage* CreateSSLBlockingPage(content::WebContents* web_contents) { |
| GURL request_url("https://example.com"); |
| bool overridable = false; |
| bool strict_enforcement = false; |
| + base::Time time_triggered_ = base::Time::NowFromSystemTime(); |
| + |
| std::string url_param; |
| if (net::GetValueForKeyInQuery(web_contents->GetURL(), |
| "url", |
| @@ -70,6 +72,15 @@ SSLBlockingPage* CreateSSLBlockingPage(content::WebContents* web_contents) { |
| &strict_enforcement_param)) { |
| strict_enforcement = strict_enforcement_param == "1"; |
| } |
| + |
| + std::string clock_manipulation_param; |
| + if (net::GetValueForKeyInQuery(web_contents->GetURL(), "clock_manipulation", |
| + &clock_manipulation_param) == 1) { |
| + cert_error = net::ERR_CERT_DATE_INVALID; |
| + time_triggered_ += |
| + base::TimeDelta::FromDays(365 * atoi(clock_manipulation_param.c_str())); |
| + } |
| + |
| net::SSLInfo ssl_info; |
| ssl_info.cert = new net::X509Certificate( |
| request_url.host(), "CA", base::Time::Max(), base::Time::Max()); |
| @@ -79,12 +90,9 @@ SSLBlockingPage* CreateSSLBlockingPage(content::WebContents* web_contents) { |
| options_mask |= SSLBlockingPage::OVERRIDABLE; |
| if (strict_enforcement) |
| options_mask |= SSLBlockingPage::STRICT_ENFORCEMENT; |
| - return new SSLBlockingPage(web_contents, |
| - cert_error, |
| - ssl_info, |
| - request_url, |
| - options_mask, |
| - base::Callback<void(bool)>()); |
| + return new SSLBlockingPage(web_contents, cert_error, ssl_info, request_url, |
| + options_mask, base::Callback<void(bool)>(), |
| + time_triggered_); |
| } |
| SafeBrowsingBlockingPage* CreateSafeBrowsingBlockingPage( |
| @@ -129,7 +137,7 @@ SafeBrowsingBlockingPage* CreateSafeBrowsingBlockingPage( |
| resource); |
| } |
| -} // namespace |
| +} // namespace |
|
lgarron
2015/02/24 02:28:37
Nit: still an uneeded extra space in the diff.
fahl
2015/02/24 21:23:23
Done.
|
| InterstitialUI::InterstitialUI(content::WebUI* web_ui) |
| : WebUIController(web_ui) { |
| @@ -185,23 +193,26 @@ void InterstitialHTMLSource::StartDataRequest( |
| if (interstitial_delegate.get()) { |
| html = interstitial_delegate.get()->GetHTMLContents(); |
| } else { |
| - html = "<html><head><title>Interstitials</title></head>" |
| - "<body><h2>Choose an interstitial<h2>" |
| - "<h3>SSL</h3>" |
| - "<a href='ssl'>example.com</a><br>" |
| - "<a href='ssl?url=https://google.com'>SSL (google.com)</a><br>" |
| - "<a href='ssl?overridable=1&strict_enforcement=0'>" |
| - " example.com (Overridable)</a>" |
| - "<br><br>" |
| - "<h3>SafeBrowsing</h3>" |
| - "<a href='safebrowsing?type=malware'>Malware</a><br>" |
| - "<a href='safebrowsing?type=phishing'>Phishing</a><br>" |
| - "<a href='safebrowsing?type=clientside_malware'>" |
| - " Client Side Malware</a><br>" |
| - "<a href='safebrowsing?type=clientside_phishing'>" |
| - " Client Side Phishing</a><br>" |
| - "</body></html>"; |
| + html = "<html><head><title>Interstitials</title></head>" |
| + "<body><h2>Choose an interstitial<h2>" |
| + "<h3>SSL</h3>" |
| + "<a href='ssl'>example.com</a><br>" |
| + "<a href='ssl?url=https://google.com'>SSL (google.com)</a><br>" |
| + "<a href='ssl?overridable=1&strict_enforcement=0'>" |
| + " example.com (Overridable)</a><br>" |
| + "<a href='ssl?clock_manipulation=1'>Clock is ahead</a><br>" |
| + "<a href='ssl?clock_manipulation=-1'>Clock is behind</a><br>" |
| + "<br><br>" |
| + "<h3>SafeBrowsing</h3>" |
| + "<a href='safebrowsing?type=malware'>Malware</a><br>" |
| + "<a href='safebrowsing?type=phishing'>Phishing</a><br>" |
| + "<a href='safebrowsing?type=clientside_malware'>" |
| + " Client Side Malware</a><br>" |
| + "<a href='safebrowsing?type=clientside_phishing'>" |
| + " Client Side Phishing</a><br>" |
| + "</body></html>"; |
| } |
| + |
|
lgarron
2015/02/24 02:28:37
Also an extra space.
fahl
2015/02/24 21:23:23
Done.
|
| scoped_refptr<base::RefCountedString> html_bytes = new base::RefCountedString; |
| html_bytes->data().assign(html.begin(), html.end()); |
| callback.Run(html_bytes.get()); |