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