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_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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 } | 87 } |
88 net::SSLInfo ssl_info; | 88 net::SSLInfo ssl_info; |
89 ssl_info.cert = new net::X509Certificate( | 89 ssl_info.cert = new net::X509Certificate( |
90 request_url.host(), "CA", base::Time::Max(), base::Time::Max()); | 90 request_url.host(), "CA", base::Time::Max(), base::Time::Max()); |
91 // This delegate doesn't create an interstitial. | 91 // This delegate doesn't create an interstitial. |
92 int options_mask = 0; | 92 int options_mask = 0; |
93 if (overridable) | 93 if (overridable) |
94 options_mask |= SSLBlockingPage::OVERRIDABLE; | 94 options_mask |= SSLBlockingPage::OVERRIDABLE; |
95 if (strict_enforcement) | 95 if (strict_enforcement) |
96 options_mask |= SSLBlockingPage::STRICT_ENFORCEMENT; | 96 options_mask |= SSLBlockingPage::STRICT_ENFORCEMENT; |
97 return new SSLBlockingPage(web_contents, | 97 return new SSLBlockingPage(web_contents, cert_error, ssl_info, request_url, |
98 cert_error, | 98 options_mask, time_triggered_, nullptr, |
99 ssl_info, | 99 base::Callback<void(bool)>()); |
100 request_url, | |
101 options_mask, | |
102 time_triggered_, | |
103 base::Callback<void(bool)>()); | |
104 } | 100 } |
105 | 101 |
106 SafeBrowsingBlockingPage* CreateSafeBrowsingBlockingPage( | 102 SafeBrowsingBlockingPage* CreateSafeBrowsingBlockingPage( |
107 content::WebContents* web_contents) { | 103 content::WebContents* web_contents) { |
108 SBThreatType threat_type = SB_THREAT_TYPE_URL_MALWARE; | 104 SBThreatType threat_type = SB_THREAT_TYPE_URL_MALWARE; |
109 GURL request_url("http://example.com"); | 105 GURL request_url("http://example.com"); |
110 std::string url_param; | 106 std::string url_param; |
111 if (net::GetValueForKeyInQuery(web_contents->GetURL(), | 107 if (net::GetValueForKeyInQuery(web_contents->GetURL(), |
112 "url", | 108 "url", |
113 &url_param)) { | 109 &url_param)) { |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 html = interstitial_delegate.get()->GetHTMLContents(); | 198 html = interstitial_delegate.get()->GetHTMLContents(); |
203 } else { | 199 } else { |
204 html = ResourceBundle::GetSharedInstance() | 200 html = ResourceBundle::GetSharedInstance() |
205 .GetRawDataResource(IDR_SECURITY_INTERSTITIAL_UI_HTML) | 201 .GetRawDataResource(IDR_SECURITY_INTERSTITIAL_UI_HTML) |
206 .as_string(); | 202 .as_string(); |
207 } | 203 } |
208 scoped_refptr<base::RefCountedString> html_bytes = new base::RefCountedString; | 204 scoped_refptr<base::RefCountedString> html_bytes = new base::RefCountedString; |
209 html_bytes->data().assign(html.begin(), html.end()); | 205 html_bytes->data().assign(html.begin(), html.end()); |
210 callback.Run(html_bytes.get()); | 206 callback.Run(html_bytes.get()); |
211 } | 207 } |
OLD | NEW |