Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // 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.
| |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_INTERSTITIALS_SECURITY_INTERSTITIAL_PAGE_H_ | |
| 6 #define CHROME_BROWSER_INTERSTITIALS_SECURITY_INTERSTITIAL_PAGE_H_ | |
| 7 | |
| 8 #include "base/strings/string16.h" | |
| 9 #include "content/public/browser/interstitial_page_delegate.h" | |
| 10 #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.
| |
| 11 #include "url/gurl.h" | |
| 12 | |
| 13 namespace base { | |
| 14 class DictionaryValue; | |
| 15 } | |
| 16 | |
| 17 namespace content { | |
| 18 class InterstitialPage; | |
| 19 class WebContents; | |
| 20 } | |
| 21 | |
| 22 class SecurityInterstitialPage : public content::InterstitialPageDelegate { | |
| 23 public: | |
| 24 SecurityInterstitialPage(content::WebContents* web_contents, | |
| 25 const GURL& url); | |
| 26 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.
| |
| 27 | |
| 28 // Creates an interstitial and shows it. | |
| 29 virtual void Show(); | |
| 30 | |
| 31 // Returns interstitial type for testing. | |
| 32 virtual const void* GetTypeForTesting() const = 0; | |
| 33 | |
| 34 // Prevents creating the actual interstitial view for testing. | |
| 35 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
| |
| 36 | |
| 37 protected: | |
| 38 // Returns true if the interstitial should create a new navigation entry. | |
| 39 virtual bool ShouldCreateNewNavigation() const = 0; | |
| 40 | |
| 41 // Populates the strings used to generate the HTML from the template. | |
| 42 virtual void PopulateInterstitialStrings( | |
| 43 base::DictionaryValue* load_time_data) = 0; | |
| 44 | |
| 45 // InterstitialPageDelegate method: | |
| 46 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.
| |
| 47 | |
| 48 // Returns the formatted host name for the request url. | |
| 49 base::string16 GetFormattedHostName(); | |
|
Lei Zhang
2014/11/20 01:35:06
const method?
meacer
2014/11/20 01:58:52
Done.
| |
| 50 | |
| 51 content::InterstitialPage* interstitial_page() const; | |
| 52 content::WebContents* web_contents() const; | |
| 53 GURL request_url() const; | |
| 54 | |
| 55 private: | |
| 56 content::WebContents* web_contents_; | |
| 57 const GURL request_url_; | |
| 58 // 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.
| |
| 59 // SecurityInterstitialPage instance. | |
| 60 content::InterstitialPage* interstitial_page_; | |
| 61 // Whether the interstitial should create a view. | |
| 62 bool create_view_; | |
| 63 }; | |
|
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.
| |
| 64 | |
| 65 #endif // CHROME_BROWSER_INTERSTITIALS_SECURITY_INTERSTITIAL_PAGE_H_ | |
| OLD | NEW |