| 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 #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 "url/gurl.h" | 10 #include "url/gurl.h" |
| 11 | 11 |
| 12 namespace base { | 12 namespace base { |
| 13 class DictionaryValue; | 13 class DictionaryValue; |
| 14 } | 14 } |
| 15 | 15 |
| 16 namespace content { | 16 namespace content { |
| 17 class InterstitialPage; | 17 class InterstitialPage; |
| 18 class WebContents; | 18 class WebContents; |
| 19 } | 19 } |
| 20 | 20 |
| 21 class SecurityInterstitialPage : public content::InterstitialPageDelegate { | 21 class SecurityInterstitialPage : public content::InterstitialPageDelegate { |
| 22 public: | 22 public: |
| 23 SecurityInterstitialPage(content::WebContents* web_contents, | 23 SecurityInterstitialPage(content::WebContents* web_contents, |
| 24 const GURL& url); | 24 const GURL& url); |
| 25 ~SecurityInterstitialPage() override; | 25 ~SecurityInterstitialPage() override; |
| 26 | 26 |
| 27 // Creates an interstitial and shows it. | 27 // Creates an interstitial and shows it. |
| 28 virtual void Show(); | 28 virtual void Show(); |
| 29 | 29 |
| 30 // Returns interstitial type for testing. | |
| 31 virtual const void* GetTypeForTesting() const = 0; | |
| 32 | |
| 33 // Prevents creating the actual interstitial view for testing. | 30 // Prevents creating the actual interstitial view for testing. |
| 34 void DontCreateViewForTesting(); | 31 void DontCreateViewForTesting(); |
| 35 | 32 |
| 36 protected: | 33 protected: |
| 37 // Returns true if the interstitial should create a new navigation entry. | 34 // Returns true if the interstitial should create a new navigation entry. |
| 38 virtual bool ShouldCreateNewNavigation() const = 0; | 35 virtual bool ShouldCreateNewNavigation() const = 0; |
| 39 | 36 |
| 40 // Populates the strings used to generate the HTML from the template. | 37 // Populates the strings used to generate the HTML from the template. |
| 41 virtual void PopulateInterstitialStrings( | 38 virtual void PopulateInterstitialStrings( |
| 42 base::DictionaryValue* load_time_data) = 0; | 39 base::DictionaryValue* load_time_data) = 0; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 57 // Once shown, |interstitial_page| takes ownership of this | 54 // Once shown, |interstitial_page| takes ownership of this |
| 58 // SecurityInterstitialPage instance. | 55 // SecurityInterstitialPage instance. |
| 59 content::InterstitialPage* interstitial_page_; | 56 content::InterstitialPage* interstitial_page_; |
| 60 // Whether the interstitial should create a view. | 57 // Whether the interstitial should create a view. |
| 61 bool create_view_; | 58 bool create_view_; |
| 62 | 59 |
| 63 DISALLOW_COPY_AND_ASSIGN(SecurityInterstitialPage); | 60 DISALLOW_COPY_AND_ASSIGN(SecurityInterstitialPage); |
| 64 }; | 61 }; |
| 65 | 62 |
| 66 #endif // CHROME_BROWSER_INTERSTITIALS_SECURITY_INTERSTITIAL_PAGE_H_ | 63 #endif // CHROME_BROWSER_INTERSTITIALS_SECURITY_INTERSTITIAL_PAGE_H_ |
| OLD | NEW |