| 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 12 matching lines...) Expand all Loading... |
| 23 | 23 |
| 24 namespace { | 24 namespace { |
| 25 | 25 |
| 26 class InterstitialHTMLSource : public content::URLDataSource { | 26 class InterstitialHTMLSource : public content::URLDataSource { |
| 27 public: | 27 public: |
| 28 InterstitialHTMLSource(Profile* profile, | 28 InterstitialHTMLSource(Profile* profile, |
| 29 content::WebContents* web_contents); | 29 content::WebContents* web_contents); |
| 30 virtual ~InterstitialHTMLSource(); | 30 virtual ~InterstitialHTMLSource(); |
| 31 | 31 |
| 32 // content::URLDataSource: | 32 // content::URLDataSource: |
| 33 virtual std::string GetMimeType(const std::string& mime_type) const OVERRIDE; | 33 virtual std::string GetMimeType(const std::string& mime_type) const override; |
| 34 virtual std::string GetSource() const OVERRIDE; | 34 virtual std::string GetSource() const override; |
| 35 virtual bool ShouldAddContentSecurityPolicy() const OVERRIDE; | 35 virtual bool ShouldAddContentSecurityPolicy() const override; |
| 36 virtual void StartDataRequest( | 36 virtual void StartDataRequest( |
| 37 const std::string& path, | 37 const std::string& path, |
| 38 int render_process_id, | 38 int render_process_id, |
| 39 int render_frame_id, | 39 int render_frame_id, |
| 40 const content::URLDataSource::GotDataCallback& callback) OVERRIDE; | 40 const content::URLDataSource::GotDataCallback& callback) override; |
| 41 | 41 |
| 42 private: | 42 private: |
| 43 Profile* profile_; | 43 Profile* profile_; |
| 44 content::WebContents* web_contents_; | 44 content::WebContents* web_contents_; |
| 45 DISALLOW_COPY_AND_ASSIGN(InterstitialHTMLSource); | 45 DISALLOW_COPY_AND_ASSIGN(InterstitialHTMLSource); |
| 46 }; | 46 }; |
| 47 | 47 |
| 48 SSLBlockingPage* CreateSSLBlockingPage(content::WebContents* web_contents) { | 48 SSLBlockingPage* CreateSSLBlockingPage(content::WebContents* web_contents) { |
| 49 // Random parameters for SSL blocking page. | 49 // Random parameters for SSL blocking page. |
| 50 int cert_error = net::ERR_CERT_CONTAINS_ERRORS; | 50 int cert_error = net::ERR_CERT_CONTAINS_ERRORS; |
| (...skipping 148 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 |