Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 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" | |
|
mmenke
2014/12/09 22:42:26
I don't think you mean to make any changes in this
meacer
2014/12/10 22:48:02
These were rebase artifacts (or "lack of rebase",
| |
| 10 #include "url/gurl.h" | 11 #include "url/gurl.h" |
| 11 | 12 |
| 12 namespace base { | 13 namespace base { |
| 13 class DictionaryValue; | 14 class DictionaryValue; |
| 14 } | 15 } |
| 15 | 16 |
| 16 namespace content { | 17 namespace content { |
| 17 class InterstitialPage; | 18 class InterstitialPage; |
| 18 class WebContents; | 19 class WebContents; |
| 19 } | 20 } |
| 20 | 21 |
| 21 class SecurityInterstitialPage : public content::InterstitialPageDelegate { | 22 class SecurityInterstitialPage : public content::InterstitialPageDelegate { |
| 22 public: | 23 public: |
| 23 SecurityInterstitialPage(content::WebContents* web_contents, | 24 SecurityInterstitialPage(content::WebContents* web_contents, |
| 24 const GURL& url); | 25 const GURL& url); |
| 25 virtual ~SecurityInterstitialPage(); | 26 virtual ~SecurityInterstitialPage() {} |
| 26 | 27 |
| 27 // Creates an interstitial and shows it. | 28 // Creates an interstitial and shows it. |
| 28 virtual void Show(); | 29 virtual void Show(); |
| 29 | 30 |
| 30 // Returns interstitial type for testing. | 31 // Returns interstitial type for testing. |
| 31 virtual const void* GetTypeForTesting() const = 0; | 32 virtual const void* GetTypeForTesting() const = 0; |
| 32 | 33 |
| 33 // Prevents creating the actual interstitial view for testing. | 34 // Prevents creating the actual interstitial view for testing. |
| 34 void DontCreateViewForTesting(); | 35 void DontCreateViewForTesting(); |
| 35 | 36 |
| 36 protected: | 37 protected: |
| 37 // Returns true if the interstitial should create a new navigation entry. | 38 // Returns true if the interstitial should create a new navigation entry. |
| 38 virtual bool ShouldCreateNewNavigation() const = 0; | 39 virtual bool ShouldCreateNewNavigation() const = 0; |
| 39 | 40 |
| 40 // Populates the strings used to generate the HTML from the template. | 41 // Populates the strings used to generate the HTML from the template. |
| 41 virtual void PopulateInterstitialStrings( | 42 virtual void PopulateInterstitialStrings( |
| 42 base::DictionaryValue* load_time_data) = 0; | 43 base::DictionaryValue* load_time_data) = 0; |
| 43 | 44 |
| 44 // InterstitialPageDelegate method: | 45 // InterstitialPageDelegate method: |
| 45 std::string GetHTMLContents() override; | 46 virtual std::string GetHTMLContents() override; |
| 46 | 47 |
| 47 // Returns the formatted host name for the request url. | 48 // Returns the formatted host name for the request url. |
| 48 base::string16 GetFormattedHostName() const; | 49 base::string16 GetFormattedHostName(); |
| 49 | 50 |
| 50 content::InterstitialPage* interstitial_page() const; | 51 content::InterstitialPage* interstitial_page() const; |
| 51 content::WebContents* web_contents() const; | 52 content::WebContents* web_contents() const; |
| 52 GURL request_url() const; | 53 GURL request_url() const; |
| 53 | 54 |
| 54 private: | 55 private: |
| 55 content::WebContents* web_contents_; | 56 content::WebContents* web_contents_; |
| 56 const GURL request_url_; | 57 const GURL request_url_; |
| 57 // Once shown, |interstitial_page| takes ownership of this | 58 // Once shown, interstitial_page takes ownership of this |
| 58 // SecurityInterstitialPage instance. | 59 // SecurityInterstitialPage instance. |
| 59 content::InterstitialPage* interstitial_page_; | 60 content::InterstitialPage* interstitial_page_; |
| 60 // Whether the interstitial should create a view. | 61 // Whether the interstitial should create a view. |
| 61 bool create_view_; | 62 bool create_view_; |
| 62 | |
| 63 DISALLOW_COPY_AND_ASSIGN(SecurityInterstitialPage); | |
| 64 }; | 63 }; |
| 65 | 64 |
| 66 #endif // CHROME_BROWSER_INTERSTITIALS_SECURITY_INTERSTITIAL_PAGE_H_ | 65 #endif // CHROME_BROWSER_INTERSTITIALS_SECURITY_INTERSTITIAL_PAGE_H_ |
| OLD | NEW |