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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 const { | 175 const { |
176 return false; | 176 return false; |
177 } | 177 } |
178 | 178 |
179 void InterstitialHTMLSource::StartDataRequest( | 179 void InterstitialHTMLSource::StartDataRequest( |
180 const std::string& path, | 180 const std::string& path, |
181 int render_process_id, | 181 int render_process_id, |
182 int render_frame_id, | 182 int render_frame_id, |
183 const content::URLDataSource::GotDataCallback& callback) { | 183 const content::URLDataSource::GotDataCallback& callback) { |
184 scoped_ptr<content::InterstitialPageDelegate> interstitial_delegate; | 184 scoped_ptr<content::InterstitialPageDelegate> interstitial_delegate; |
185 if (base::StartsWithASCII(path, "ssl", true)) { | 185 if (base::StartsWith(path, "ssl", base::CompareCase::SENSITIVE)) { |
186 interstitial_delegate.reset(CreateSSLBlockingPage(web_contents_)); | 186 interstitial_delegate.reset(CreateSSLBlockingPage(web_contents_)); |
187 } else if (base::StartsWithASCII(path, "safebrowsing", true)) { | 187 } else if (base::StartsWith(path, "safebrowsing", |
| 188 base::CompareCase::SENSITIVE)) { |
188 interstitial_delegate.reset(CreateSafeBrowsingBlockingPage(web_contents_)); | 189 interstitial_delegate.reset(CreateSafeBrowsingBlockingPage(web_contents_)); |
189 } | 190 } |
190 | 191 |
191 std::string html; | 192 std::string html; |
192 if (interstitial_delegate.get()) { | 193 if (interstitial_delegate.get()) { |
193 html = interstitial_delegate.get()->GetHTMLContents(); | 194 html = interstitial_delegate.get()->GetHTMLContents(); |
194 } else { | 195 } else { |
195 html = ResourceBundle::GetSharedInstance() | 196 html = ResourceBundle::GetSharedInstance() |
196 .GetRawDataResource(IDR_SECURITY_INTERSTITIAL_UI_HTML) | 197 .GetRawDataResource(IDR_SECURITY_INTERSTITIAL_UI_HTML) |
197 .as_string(); | 198 .as_string(); |
198 } | 199 } |
199 scoped_refptr<base::RefCountedString> html_bytes = new base::RefCountedString; | 200 scoped_refptr<base::RefCountedString> html_bytes = new base::RefCountedString; |
200 html_bytes->data().assign(html.begin(), html.end()); | 201 html_bytes->data().assign(html.begin(), html.end()); |
201 callback.Run(html_bytes.get()); | 202 callback.Run(html_bytes.get()); |
202 } | 203 } |
OLD | NEW |