Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 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. | |
| 4 | |
| 5 #ifndef COMPONENTS_SECURITY_INTERSTITIALS_CORE_SAFE_BROWSING_LOUD_ERROR_UI_H_ | |
| 6 #define COMPONENTS_SECURITY_INTERSTITIALS_CORE_SAFE_BROWSING_LOUD_ERROR_UI_H_ | |
| 7 | |
| 8 #include "base/macros.h" | |
| 9 #include "base/time/time.h" | |
| 10 #include "base/values.h" | |
| 11 #include "components/security_interstitials/core/base_safe_browsing_error_ui.h" | |
| 12 #include "components/security_interstitials/core/controller_client.h" | |
| 13 #include "url/gurl.h" | |
| 14 | |
| 15 namespace security_interstitials { | |
| 16 | |
| 17 // This class displays UI for Safe Browsing errors that block page loads. This | |
| 18 // class is purely about visual display; it does not do any error-handling logic | |
| 19 // to determine what type of error should be displayed when. | |
| 20 class SafeBrowsingLoudErrorUI { | |
| 21 public: | |
| 22 SafeBrowsingLoudErrorUI( | |
| 23 const GURL& request_url, | |
| 24 const GURL& main_frame_url, | |
| 25 BaseSafeBrowsingErrorUI::SBInterstitialReason reason, | |
| 26 const BaseSafeBrowsingErrorUI::SBErrorDisplayOptions& display_options, | |
| 27 const std::string& app_locale, | |
| 28 const base::Time& time_triggered, | |
| 29 ControllerClient* controller); | |
| 30 ~SafeBrowsingLoudErrorUI(); | |
| 31 | |
| 32 void PopulateStringsForHTML(base::DictionaryValue* load_time_data); | |
| 33 void HandleCommand(SecurityInterstitialCommands command); | |
| 34 | |
| 35 // Checks if we should even show the extended reporting option. We don't show | |
| 36 // it in incognito mode or if kSafeBrowsingExtendedReportingOptInAllowed | |
| 37 // preference is disabled. | |
| 38 bool CanShowExtendedReportingOption(); | |
| 39 | |
| 40 BaseSafeBrowsingErrorUI base_safe_browsing_error_ui; | |
|
felt
2017/05/03 18:17:01
I noticed that you've added the base class as a va
| |
| 41 | |
| 42 private: | |
| 43 // Fills the passed dictionary with the values to be passed to the template | |
| 44 // when creating the HTML. | |
| 45 void PopulateExtendedReportingOption(base::DictionaryValue* load_time_data); | |
| 46 void PopulateMalwareLoadTimeData(base::DictionaryValue* load_time_data); | |
| 47 void PopulateHarmfulLoadTimeData(base::DictionaryValue* load_time_data); | |
| 48 void PopulatePhishingLoadTimeData(base::DictionaryValue* load_time_data); | |
| 49 | |
| 50 const GURL request_url_; | |
| 51 const GURL main_frame_url_; | |
| 52 const BaseSafeBrowsingErrorUI::SBInterstitialReason interstitial_reason_; | |
| 53 BaseSafeBrowsingErrorUI::SBErrorDisplayOptions display_options_; | |
| 54 const std::string app_locale_; | |
| 55 const base::Time time_triggered_; | |
| 56 | |
| 57 ControllerClient* controller_; | |
| 58 | |
| 59 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingLoudErrorUI); | |
| 60 }; | |
| 61 | |
| 62 } // security_interstitials | |
| 63 | |
| 64 #endif // COMPONENTS_SECURITY_INTERSTITIALS_CORE_SAFE_BROWSING_LOUD_ERROR_UI_H_ | |
| OLD | NEW |