| 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 "strict_enforcement", | 69 "strict_enforcement", |
| 70 &strict_enforcement_param)) { | 70 &strict_enforcement_param)) { |
| 71 strict_enforcement = strict_enforcement_param == "1"; | 71 strict_enforcement = strict_enforcement_param == "1"; |
| 72 } | 72 } |
| 73 net::SSLInfo ssl_info; | 73 net::SSLInfo ssl_info; |
| 74 ssl_info.cert = new net::X509Certificate( | 74 ssl_info.cert = new net::X509Certificate( |
| 75 request_url.host(), "CA", base::Time::Max(), base::Time::Max()); | 75 request_url.host(), "CA", base::Time::Max(), base::Time::Max()); |
| 76 // This delegate doesn't create an interstitial. | 76 // This delegate doesn't create an interstitial. |
| 77 int options_mask = 0; | 77 int options_mask = 0; |
| 78 if (overridable) | 78 if (overridable) |
| 79 options_mask = SSLBlockingPage::OVERRIDABLE; | 79 options_mask |= SSLBlockingPage::OVERRIDABLE; |
| 80 if (strict_enforcement) | 80 if (strict_enforcement) |
| 81 options_mask = SSLBlockingPage::STRICT_ENFORCEMENT; | 81 options_mask |= SSLBlockingPage::STRICT_ENFORCEMENT; |
| 82 return new SSLBlockingPage(web_contents, | 82 return new SSLBlockingPage(web_contents, |
| 83 cert_error, | 83 cert_error, |
| 84 ssl_info, | 84 ssl_info, |
| 85 request_url, | 85 request_url, |
| 86 options_mask, | 86 options_mask, |
| 87 base::Callback<void(bool)>()); | 87 base::Callback<void(bool)>()); |
| 88 } | 88 } |
| 89 | 89 |
| 90 SafeBrowsingBlockingPage* CreateSafeBrowsingBlockingPage( | 90 SafeBrowsingBlockingPage* CreateSafeBrowsingBlockingPage( |
| 91 content::WebContents* web_contents) { | 91 content::WebContents* web_contents) { |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 "<a href='safebrowsing?type=clientside_malware'>" | 199 "<a href='safebrowsing?type=clientside_malware'>" |
| 200 " Client Side Malware</a><br>" | 200 " Client Side Malware</a><br>" |
| 201 "<a href='safebrowsing?type=clientside_phishing'>" | 201 "<a href='safebrowsing?type=clientside_phishing'>" |
| 202 " Client Side Phishing</a><br>" | 202 " Client Side Phishing</a><br>" |
| 203 "</body></html>"; | 203 "</body></html>"; |
| 204 } | 204 } |
| 205 scoped_refptr<base::RefCountedString> html_bytes = new base::RefCountedString; | 205 scoped_refptr<base::RefCountedString> html_bytes = new base::RefCountedString; |
| 206 html_bytes->data().assign(html.begin(), html.end()); | 206 html_bytes->data().assign(html.begin(), html.end()); |
| 207 callback.Run(html_bytes.get()); | 207 callback.Run(html_bytes.get()); |
| 208 } | 208 } |
| OLD | NEW |