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

Side by Side Diff: chrome/browser/ui/webui/interstitials/interstitial_ui.cc

Issue 1223233002: Common Name Mismatch Handler For WWW Subdomain Mismatch case (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Browsertests using MockCertVerifier Created 5 years, 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/webui/interstitials/interstitial_ui.h" 5 #include "chrome/browser/ui/webui/interstitials/interstitial_ui.h"
6 6
7 #include "base/strings/string_number_conversions.h" 7 #include "base/strings/string_number_conversions.h"
8 #include "base/strings/string_util.h" 8 #include "base/strings/string_util.h"
9 #include "chrome/browser/browser_process.h" 9 #include "chrome/browser/browser_process.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 ssl_info.cert = new net::X509Certificate( 109 ssl_info.cert = new net::X509Certificate(
110 request_url.host(), "CA", base::Time::Max(), base::Time::Max()); 110 request_url.host(), "CA", base::Time::Max(), base::Time::Max());
111 // This delegate doesn't create an interstitial. 111 // This delegate doesn't create an interstitial.
112 int options_mask = 0; 112 int options_mask = 0;
113 if (overridable) 113 if (overridable)
114 options_mask |= SSLBlockingPage::OVERRIDABLE; 114 options_mask |= SSLBlockingPage::OVERRIDABLE;
115 if (strict_enforcement) 115 if (strict_enforcement)
116 options_mask |= SSLBlockingPage::STRICT_ENFORCEMENT; 116 options_mask |= SSLBlockingPage::STRICT_ENFORCEMENT;
117 return new SSLBlockingPage(web_contents, cert_error, ssl_info, request_url, 117 return new SSLBlockingPage(web_contents, cert_error, ssl_info, request_url,
118 options_mask, time_triggered_, nullptr, 118 options_mask, time_triggered_, nullptr,
119 base::Callback<void(bool)>()); 119 base::Callback<void(bool)>(), GURL());
120 } 120 }
121 121
122 SafeBrowsingBlockingPage* CreateSafeBrowsingBlockingPage( 122 SafeBrowsingBlockingPage* CreateSafeBrowsingBlockingPage(
123 content::WebContents* web_contents) { 123 content::WebContents* web_contents) {
124 SBThreatType threat_type = SB_THREAT_TYPE_URL_MALWARE; 124 SBThreatType threat_type = SB_THREAT_TYPE_URL_MALWARE;
125 GURL request_url("http://example.com"); 125 GURL request_url("http://example.com");
126 std::string url_param; 126 std::string url_param;
127 if (net::GetValueForKeyInQuery(web_contents->GetURL(), 127 if (net::GetValueForKeyInQuery(web_contents->GetURL(),
128 "url", 128 "url",
129 &url_param)) { 129 &url_param)) {
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 html = interstitial_delegate.get()->GetHTMLContents(); 267 html = interstitial_delegate.get()->GetHTMLContents();
268 } else { 268 } else {
269 html = ResourceBundle::GetSharedInstance() 269 html = ResourceBundle::GetSharedInstance()
270 .GetRawDataResource(IDR_SECURITY_INTERSTITIAL_UI_HTML) 270 .GetRawDataResource(IDR_SECURITY_INTERSTITIAL_UI_HTML)
271 .as_string(); 271 .as_string();
272 } 272 }
273 scoped_refptr<base::RefCountedString> html_bytes = new base::RefCountedString; 273 scoped_refptr<base::RefCountedString> html_bytes = new base::RefCountedString;
274 html_bytes->data().assign(html.begin(), html.end()); 274 html_bytes->data().assign(html.begin(), html.end());
275 callback.Run(html_bytes.get()); 275 callback.Run(html_bytes.get());
276 } 276 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698