| OLD | NEW |
| 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_util.h" | 7 #include "base/strings/string_util.h" |
| 8 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/safe_browsing/safe_browsing_blocking_page.h" | 10 #include "chrome/browser/safe_browsing/safe_browsing_blocking_page.h" |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 std::string strict_enforcement_param; | 68 std::string strict_enforcement_param; |
| 69 if (net::GetValueForKeyInQuery(web_contents->GetURL(), | 69 if (net::GetValueForKeyInQuery(web_contents->GetURL(), |
| 70 "strict_enforcement", | 70 "strict_enforcement", |
| 71 &strict_enforcement_param)) { | 71 &strict_enforcement_param)) { |
| 72 strict_enforcement = strict_enforcement_param == "1"; | 72 strict_enforcement = strict_enforcement_param == "1"; |
| 73 } | 73 } |
| 74 net::SSLInfo ssl_info; | 74 net::SSLInfo ssl_info; |
| 75 ssl_info.cert = new net::X509Certificate( | 75 ssl_info.cert = new net::X509Certificate( |
| 76 request_url.host(), "CA", base::Time::Max(), base::Time::Max()); | 76 request_url.host(), "CA", base::Time::Max(), base::Time::Max()); |
| 77 // This delegate doesn't create an interstitial. | 77 // This delegate doesn't create an interstitial. |
| 78 return new SSLBlockingPage(web_contents, cert_error, ssl_info, | 78 return new SSLBlockingPage(web_contents, |
| 79 request_url, overridable, | 79 cert_error, |
| 80 ssl_info, |
| 81 request_url, |
| 82 overridable, |
| 80 strict_enforcement, | 83 strict_enforcement, |
| 84 false, |
| 81 base::Callback<void(bool)>()); | 85 base::Callback<void(bool)>()); |
| 82 } | 86 } |
| 83 | 87 |
| 84 SafeBrowsingBlockingPage* CreateSafeBrowsingBlockingPage( | 88 SafeBrowsingBlockingPage* CreateSafeBrowsingBlockingPage( |
| 85 content::WebContents* web_contents) { | 89 content::WebContents* web_contents) { |
| 86 SBThreatType threat_type = SB_THREAT_TYPE_URL_MALWARE; | 90 SBThreatType threat_type = SB_THREAT_TYPE_URL_MALWARE; |
| 87 GURL request_url("http://example.com"); | 91 GURL request_url("http://example.com"); |
| 88 std::string url_param; | 92 std::string url_param; |
| 89 if (net::GetValueForKeyInQuery(web_contents->GetURL(), | 93 if (net::GetValueForKeyInQuery(web_contents->GetURL(), |
| 90 "url", | 94 "url", |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 "<a href='safebrowsing?type=clientside_malware'>" | 197 "<a href='safebrowsing?type=clientside_malware'>" |
| 194 " Client Side Malware</a><br>" | 198 " Client Side Malware</a><br>" |
| 195 "<a href='safebrowsing?type=clientside_phishing'>" | 199 "<a href='safebrowsing?type=clientside_phishing'>" |
| 196 " Client Side Phishing</a><br>" | 200 " Client Side Phishing</a><br>" |
| 197 "</body></html>"; | 201 "</body></html>"; |
| 198 } | 202 } |
| 199 scoped_refptr<base::RefCountedString> html_bytes = new base::RefCountedString; | 203 scoped_refptr<base::RefCountedString> html_bytes = new base::RefCountedString; |
| 200 html_bytes->data().assign(html.begin(), html.end()); | 204 html_bytes->data().assign(html.begin(), html.end()); |
| 201 callback.Run(html_bytes.get()); | 205 callback.Run(html_bytes.get()); |
| 202 } | 206 } |
| OLD | NEW |