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..965154a1783f6cfe4cce83cecd985061dbc407d8 |
--- /dev/null |
+++ b/chrome/browser/interstitials/security_interstitial_page.h |
@@ -0,0 +1,65 @@ |
+// Copyright (c) 2014 The Chromium Authors. All rights reserved. |
Lei Zhang
2014/11/20 01:35:12
nit: no "(c)" going forward
meacer
2014/11/20 01:58:52
Done.
|
+// 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" |
Lei Zhang
2014/11/20 01:35:06
This should be in the .cc file as chrome/grit/brow
meacer
2014/11/20 01:58:52
Done.
|
+#include "url/gurl.h" |
+ |
+namespace base { |
+class DictionaryValue; |
+} |
+ |
+namespace content { |
+class InterstitialPage; |
+class WebContents; |
+} |
+ |
+class SecurityInterstitialPage : public content::InterstitialPageDelegate { |
+ public: |
+ SecurityInterstitialPage(content::WebContents* web_contents, |
+ const GURL& url); |
+ virtual ~SecurityInterstitialPage() {} |
Lei Zhang
2014/11/20 01:35:12
bots may complain if the empty body isn't in the .
meacer
2014/11/20 01:58:52
Done.
|
+ |
+ // Creates an interstitial and shows it. |
+ virtual void Show(); |
+ |
+ // Returns interstitial type for testing. |
+ virtual const void* GetTypeForTesting() const = 0; |
+ |
+ // Prevents creating the actual interstitial view for testing. |
+ void DontCreateViewForTesting(); |
Lei Zhang
2014/11/20 01:35:06
Maybe PreventCreatingViewForTesting?
meacer
2014/11/20 01:58:52
This name is from InterstitialPage, I wanted to ke
|
+ |
+ protected: |
+ // Returns true if the interstitial should create a new navigation entry. |
+ virtual bool ShouldCreateNewNavigation() const = 0; |
+ |
+ // Populates the strings used to generate the HTML from the template. |
+ virtual void PopulateInterstitialStrings( |
+ base::DictionaryValue* load_time_data) = 0; |
+ |
+ // InterstitialPageDelegate method: |
+ virtual std::string GetHTMLContents() override; |
Lei Zhang
2014/11/20 01:35:06
no need for virtual if you are using override now.
meacer
2014/11/20 01:58:52
Done.
|
+ |
+ // Returns the formatted host name for the request url. |
+ base::string16 GetFormattedHostName(); |
Lei Zhang
2014/11/20 01:35:06
const method?
meacer
2014/11/20 01:58:52
Done.
|
+ |
+ 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 |
Lei Zhang
2014/11/20 01:35:12
interstitial_page -> |interstitial_page_| ?
meacer
2014/11/20 01:58:52
Done.
|
+ // SecurityInterstitialPage instance. |
+ content::InterstitialPage* interstitial_page_; |
+ // Whether the interstitial should create a view. |
+ bool create_view_; |
+}; |
Lei Zhang
2014/11/20 01:35:06
DISALLOW_COPY_AND_ASSIGN() unless you have some re
meacer
2014/11/20 01:58:52
Done.
|
+ |
+#endif // CHROME_BROWSER_INTERSTITIALS_SECURITY_INTERSTITIAL_PAGE_H_ |