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

Unified Diff: chrome/browser/ui/webui/interstitials/interstitial_ui.cc

Issue 940543003: added clock interstitial to chrome://interstitials (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: added clock interstitial to chrome://interstitials Created 5 years, 10 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_error_handler.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..5b6ec147228e7f0ff0959814da303c2c744b784f 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()));
Bernhard Bauer 2015/02/25 16:41:08 There is base::StringToInt (from base/strings/stri
fahl 2015/02/26 04:52:41 Done.
+ }
+
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(
@@ -185,22 +193,24 @@ 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>"
Bernhard Bauer 2015/02/25 16:41:08 Would it make sense to put this into chrome/browse
fahl 2015/02/26 03:00:26 I think that probably makes sense. What's felt's a
felt 2015/02/26 03:14:00 Sounds fine to me.
fahl 2015/02/26 04:52:41 Done.
+ "<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>";
}
scoped_refptr<base::RefCountedString> html_bytes = new base::RefCountedString;
html_bytes->data().assign(html.begin(), html.end());
« no previous file with comments | « chrome/browser/ssl/ssl_error_handler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698