ozone: evdev: Sync caps lock LED state to evdev
[chromium-blink-merge.git] / chrome / browser / interstitials / security_interstitial_page.h
blob98e8e197eeb6f766f42631fe9c890f1764e0ca36
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"
10 #include "url/gurl.h"
12 namespace base {
13 class DictionaryValue;
16 namespace content {
17 class InterstitialPage;
18 class WebContents;
21 class SecurityInterstitialPage : public content::InterstitialPageDelegate {
22 public:
23 SecurityInterstitialPage(content::WebContents* web_contents,
24 const GURL& url);
25 ~SecurityInterstitialPage() override;
27 // Creates an interstitial and shows it.
28 virtual void Show();
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();
36 protected:
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;
54 private:
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.
61 bool create_view_;
63 DISALLOW_COPY_AND_ASSIGN(SecurityInterstitialPage);
66 #endif // CHROME_BROWSER_INTERSTITIALS_SECURITY_INTERSTITIAL_PAGE_H_