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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_INTERSTITIALS_SECURITY_INTERSTITIAL_PAGE_H_
6 #define CHROME_BROWSER_INTERSTITIALS_SECURITY_INTERSTITIAL_PAGE_H_
8 #include "base/strings/string16.h"
9 #include "content/public/browser/interstitial_page_delegate.h"
13 class DictionaryValue
;
17 class InterstitialPage
;
21 class SecurityInterstitialPage
: public content::InterstitialPageDelegate
{
23 SecurityInterstitialPage(content::WebContents
* web_contents
,
25 ~SecurityInterstitialPage() override
;
27 // Creates an interstitial and shows it.
30 // Returns interstitial type for testing.
31 virtual const void* GetTypeForTesting() const = 0;
33 // Prevents creating the actual interstitial view for testing.
34 void DontCreateViewForTesting();
37 // Returns true if the interstitial should create a new navigation entry.
38 virtual bool ShouldCreateNewNavigation() const = 0;
40 // Populates the strings used to generate the HTML from the template.
41 virtual void PopulateInterstitialStrings(
42 base::DictionaryValue
* load_time_data
) = 0;
44 // InterstitialPageDelegate method:
45 std::string
GetHTMLContents() override
;
47 // Returns the formatted host name for the request url.
48 base::string16
GetFormattedHostName() const;
50 content::InterstitialPage
* interstitial_page() const;
51 content::WebContents
* web_contents() const;
52 GURL
request_url() const;
55 content::WebContents
* web_contents_
;
56 const GURL request_url_
;
57 // Once shown, |interstitial_page| takes ownership of this
58 // SecurityInterstitialPage instance.
59 content::InterstitialPage
* interstitial_page_
;
60 // Whether the interstitial should create a view.
63 DISALLOW_COPY_AND_ASSIGN(SecurityInterstitialPage
);
66 #endif // CHROME_BROWSER_INTERSTITIALS_SECURITY_INTERSTITIAL_PAGE_H_