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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 content::NavigationController* controller = | 117 content::NavigationController* controller = |
118 &web_contents->GetController(); | 118 &web_contents->GetController(); |
119 controller->DiscardNonCommittedEntries(); | 119 controller->DiscardNonCommittedEntries(); |
120 } | 120 } |
121 } | 121 } |
122 SafeBrowsingBlockingPage::UnsafeResource resource; | 122 SafeBrowsingBlockingPage::UnsafeResource resource; |
123 resource.url = request_url; | 123 resource.url = request_url; |
124 resource.threat_type = threat_type; | 124 resource.threat_type = threat_type; |
125 // Create a blocking page without showing the interstitial. | 125 // Create a blocking page without showing the interstitial. |
126 return SafeBrowsingBlockingPage::CreateBlockingPage( | 126 return SafeBrowsingBlockingPage::CreateBlockingPage( |
127 g_browser_process->safe_browsing_service()->ui_manager(), | 127 g_browser_process->safe_browsing_service()->ui_manager().get(), |
128 web_contents, | 128 web_contents, |
129 resource); | 129 resource); |
130 } | 130 } |
131 | 131 |
132 } // namespace | 132 } // namespace |
133 | 133 |
134 InterstitialUI::InterstitialUI(content::WebUI* web_ui) | 134 InterstitialUI::InterstitialUI(content::WebUI* web_ui) |
135 : WebUIController(web_ui) { | 135 : WebUIController(web_ui) { |
136 Profile* profile = Profile::FromWebUI(web_ui); | 136 Profile* profile = Profile::FromWebUI(web_ui); |
137 scoped_ptr<InterstitialHTMLSource> html_source( | 137 scoped_ptr<InterstitialHTMLSource> html_source( |
(...skipping 61 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 |