| OLD | NEW |
| 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 #ifndef CHROME_BROWSER_INTERSTITIALS_SECURITY_INTERSTITIAL_PAGE_H_ | 5 #ifndef CHROME_BROWSER_INTERSTITIALS_SECURITY_INTERSTITIAL_PAGE_H_ |
| 6 #define CHROME_BROWSER_INTERSTITIALS_SECURITY_INTERSTITIAL_PAGE_H_ | 6 #define CHROME_BROWSER_INTERSTITIALS_SECURITY_INTERSTITIAL_PAGE_H_ |
| 7 | 7 |
| 8 #include "base/strings/string16.h" | 8 #include "base/strings/string16.h" |
| 9 #include "content/public/browser/interstitial_page_delegate.h" | 9 #include "content/public/browser/interstitial_page_delegate.h" |
| 10 #include "grit/browser_resources.h" | 10 #include "grit/browser_resources.h" |
| 11 #include "url/gurl.h" | 11 #include "url/gurl.h" |
| 12 | 12 |
| 13 namespace base { | 13 namespace base { |
| 14 class DictionaryValue; | 14 class DictionaryValue; |
| 15 } | 15 } |
| 16 | 16 |
| 17 namespace content { | 17 namespace content { |
| 18 class InterstitialPage; | 18 class InterstitialPage; |
| 19 class WebContents; | 19 class WebContents; |
| 20 } | 20 } |
| 21 | 21 |
| 22 class SecurityInterstitialPage : public content::InterstitialPageDelegate { | 22 class SecurityInterstitialPage : public content::InterstitialPageDelegate { |
| 23 public: | 23 public: |
| 24 enum Type { | 24 enum Type { |
| 25 SAFEBROWSING, | 25 SAFEBROWSING, |
| 26 SSL | 26 SSL, |
| 27 CAPTIVE_PORTAL |
| 27 }; | 28 }; |
| 28 SecurityInterstitialPage(content::WebContents* web_contents, | 29 SecurityInterstitialPage(content::WebContents* web_contents, |
| 29 const GURL& url); | 30 const GURL& url); |
| 30 virtual ~SecurityInterstitialPage() {} | 31 virtual ~SecurityInterstitialPage() {} |
| 31 | 32 |
| 32 // Creates an interstitial and shows it. | 33 // Creates an interstitial and shows it. |
| 33 virtual void Show(); | 34 virtual void Show(); |
| 34 // Returns interstitial type for testing. | 35 // Returns interstitial type for testing. |
| 35 virtual Type GetTypeForTesting() const = 0; | 36 virtual Type GetTypeForTesting() const = 0; |
| 36 // Prevents creating the actual interstitial view for testing. | 37 // Prevents creating the actual interstitial view for testing. |
| (...skipping 20 matching lines...) Expand all Loading... |
| 57 content::WebContents* web_contents_; | 58 content::WebContents* web_contents_; |
| 58 const GURL request_url_; | 59 const GURL request_url_; |
| 59 // Once shown, interstitial_page takes ownership of this | 60 // Once shown, interstitial_page takes ownership of this |
| 60 // SecurityInterstitialPage instance. | 61 // SecurityInterstitialPage instance. |
| 61 content::InterstitialPage* interstitial_page_; | 62 content::InterstitialPage* interstitial_page_; |
| 62 // Whether the interstitial should create a view. | 63 // Whether the interstitial should create a view. |
| 63 bool create_view_; | 64 bool create_view_; |
| 64 }; | 65 }; |
| 65 | 66 |
| 66 #endif // CHROME_BROWSER_INTERSTITIALS_SECURITY_INTERSTITIAL_PAGE_H_ | 67 #endif // CHROME_BROWSER_INTERSTITIALS_SECURITY_INTERSTITIAL_PAGE_H_ |
| OLD | NEW |