Chromium Code Reviews| Index: chrome/browser/interstitials/security_interstitial_page.h |
| diff --git a/chrome/browser/interstitials/security_interstitial_page.h b/chrome/browser/interstitials/security_interstitial_page.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..7625eb3cdc529e36d9d783df1afb21b6f8f4d9f8 |
| --- /dev/null |
| +++ b/chrome/browser/interstitials/security_interstitial_page.h |
| @@ -0,0 +1,66 @@ |
| +// Copyright (c) 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROME_BROWSER_INTERSTITIALS_SECURITY_INTERSTITIAL_PAGE_H_ |
| +#define CHROME_BROWSER_INTERSTITIALS_SECURITY_INTERSTITIAL_PAGE_H_ |
| + |
| +#include "base/strings/string16.h" |
| +#include "content/public/browser/interstitial_page_delegate.h" |
| +#include "grit/browser_resources.h" |
| +#include "url/gurl.h" |
| + |
| +namespace base { |
| +class DictionaryValue; |
| +} |
| + |
| +namespace content { |
| +class InterstitialPage; |
| +class WebContents; |
| +} |
| + |
| +class SecurityInterstitialPage : public content::InterstitialPageDelegate { |
| + public: |
| + enum Type { |
| + SAFEBROWSING, |
| + SSL |
| + }; |
|
mattm
2014/10/14 08:39:19
this seems like a bit of a layering violation
meacer
2014/10/20 22:43:15
How do you feel about moving both SSL and SafeBrow
|
| + SecurityInterstitialPage(content::WebContents* web_contents, |
| + const GURL& url); |
| + virtual ~SecurityInterstitialPage() {} |
| + |
| + // Creates an interstitial and shows it. |
| + virtual void Show(); |
| + // Returns interstitial type for testing. |
| + virtual Type GetTypeForTesting() const = 0; |
| + // Prevents creating the actual interstitial view for testing. |
| + void DontCreateViewForTesting(); |
| + |
| + protected: |
| + // Returns true if the interstitial should create a new navigation entry. |
| + virtual bool ShouldCreateNewNavigation() const = 0; |
| + |
| + virtual void PopulateLoadTimeData( |
|
mmenke
2014/11/10 16:42:58
Should document this.
meacer
2014/11/19 21:29:59
Done.
|
| + base::DictionaryValue* load_time_data) = 0; |
| + |
| + // InterstitialPageDelegate method: |
| + virtual std::string GetHTMLContents() OVERRIDE; |
| + |
| + // Returns the formatted host name for the request url. |
| + base::string16 GetFormattedHostName(); |
| + |
| + content::InterstitialPage* interstitial_page() const; |
| + content::WebContents* web_contents() const; |
| + GURL request_url() const; |
| + |
| + private: |
| + content::WebContents* web_contents_; |
| + const GURL request_url_; |
| + // Once shown, interstitial_page takes ownership of this |
| + // SecurityInterstitialPage instance. |
| + content::InterstitialPage* interstitial_page_; |
| + // Whether the interstitial should create a view. |
| + bool create_view_; |
| +}; |
| + |
| +#endif // CHROME_BROWSER_INTERSTITIALS_SECURITY_INTERSTITIAL_PAGE_H_ |