Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_INTERSTITIALS_SECURITY_INTERSTITIAL_PAGE_H_ | 5 #ifndef CHROME_BROWSER_INTERSTITIALS_SECURITY_INTERSTITIAL_PAGE_H_ |
| 6 #define CHROME_BROWSER_INTERSTITIALS_SECURITY_INTERSTITIAL_PAGE_H_ | 6 #define CHROME_BROWSER_INTERSTITIALS_SECURITY_INTERSTITIAL_PAGE_H_ |
| 7 | 7 |
| 8 #include "base/strings/string16.h" | 8 #include "base/strings/string16.h" |
| 9 #include "content/public/browser/interstitial_page_delegate.h" | 9 #include "content/public/browser/interstitial_page_delegate.h" |
| 10 #include "url/gurl.h" | 10 #include "url/gurl.h" |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 56 const GURL request_url_; | 56 const GURL request_url_; |
| 57 // Once shown, |interstitial_page| takes ownership of this | 57 // Once shown, |interstitial_page| takes ownership of this |
| 58 // SecurityInterstitialPage instance. | 58 // SecurityInterstitialPage instance. |
| 59 content::InterstitialPage* interstitial_page_; | 59 content::InterstitialPage* interstitial_page_; |
| 60 // Whether the interstitial should create a view. | 60 // Whether the interstitial should create a view. |
| 61 bool create_view_; | 61 bool create_view_; |
| 62 | 62 |
| 63 DISALLOW_COPY_AND_ASSIGN(SecurityInterstitialPage); | 63 DISALLOW_COPY_AND_ASSIGN(SecurityInterstitialPage); |
| 64 }; | 64 }; |
| 65 | 65 |
| 66 class SecurityInterstitialPageWithExtendedReporting | |
|
felt
2015/02/19 00:32:32
I'm debating the pros and cons of having this as a
estark
2015/02/19 02:32:08
Hmm, TBH the latter option didn't really occur to
felt
2015/02/20 19:20:34
Pro - it cleanly separates out the reporting logic
estark
2015/02/23 20:42:18
Okay, I find that Con fairly convincing -- done.
| |
| 67 : public SecurityInterstitialPage { | |
| 68 public: | |
| 69 SecurityInterstitialPageWithExtendedReporting( | |
| 70 content::WebContents* web_contents, | |
| 71 const GURL& url); | |
| 72 | |
| 73 protected: | |
| 74 // Record the user's preference for reporting information about | |
| 75 // malware and SSL errors. | |
| 76 void SetReportingPreference(bool report); | |
| 77 | |
| 78 // Fills the passed dictionary with the values to be passed to the template | |
| 79 // when creating the HTML. | |
| 80 virtual void PopulateExtendedReportingOption( | |
| 81 base::DictionaryValue* load_time_data) = 0; | |
| 82 | |
| 83 // Returns the boolean value of the given |pref| from the PrefService of the | |
| 84 // Profile associated with |web_contents_|. | |
| 85 bool IsPrefEnabled(const char* pref); | |
| 86 }; | |
| 87 | |
| 88 namespace interstitials { | |
| 89 // Constants used to communicate with the JavaScript. | |
| 90 extern const char kBoxChecked[]; | |
| 91 extern const char kDisplayCheckBox[]; | |
| 92 extern const char kPrivacyLinkHtml[]; | |
| 93 } | |
| 94 | |
| 66 #endif // CHROME_BROWSER_INTERSTITIALS_SECURITY_INTERSTITIAL_PAGE_H_ | 95 #endif // CHROME_BROWSER_INTERSTITIALS_SECURITY_INTERSTITIAL_PAGE_H_ |
| OLD | NEW |