Chromium Code Reviews| Index: components/security_interstitials/core/safe_browsing_loud_error_ui.h |
| diff --git a/components/security_interstitials/core/safe_browsing_loud_error_ui.h b/components/security_interstitials/core/safe_browsing_loud_error_ui.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..7a7499823bc1aab6093d4f7354b76ce671e76796 |
| --- /dev/null |
| +++ b/components/security_interstitials/core/safe_browsing_loud_error_ui.h |
| @@ -0,0 +1,64 @@ |
| +// Copyright 2016 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 COMPONENTS_SECURITY_INTERSTITIALS_CORE_SAFE_BROWSING_LOUD_ERROR_UI_H_ |
| +#define COMPONENTS_SECURITY_INTERSTITIALS_CORE_SAFE_BROWSING_LOUD_ERROR_UI_H_ |
| + |
| +#include "base/macros.h" |
| +#include "base/time/time.h" |
| +#include "base/values.h" |
| +#include "components/security_interstitials/core/base_safe_browsing_error_ui.h" |
| +#include "components/security_interstitials/core/controller_client.h" |
| +#include "url/gurl.h" |
| + |
| +namespace security_interstitials { |
| + |
| +// This class displays UI for Safe Browsing errors that block page loads. This |
| +// class is purely about visual display; it does not do any error-handling logic |
| +// to determine what type of error should be displayed when. |
| +class SafeBrowsingLoudErrorUI { |
| + public: |
| + SafeBrowsingLoudErrorUI( |
| + const GURL& request_url, |
| + const GURL& main_frame_url, |
| + BaseSafeBrowsingErrorUI::SBInterstitialReason reason, |
| + const BaseSafeBrowsingErrorUI::SBErrorDisplayOptions& display_options, |
| + const std::string& app_locale, |
| + const base::Time& time_triggered, |
| + ControllerClient* controller); |
| + ~SafeBrowsingLoudErrorUI(); |
| + |
| + void PopulateStringsForHTML(base::DictionaryValue* load_time_data); |
| + void HandleCommand(SecurityInterstitialCommands command); |
| + |
| + // Checks if we should even show the extended reporting option. We don't show |
| + // it in incognito mode or if kSafeBrowsingExtendedReportingOptInAllowed |
| + // preference is disabled. |
| + bool CanShowExtendedReportingOption(); |
| + |
| + 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
|
| + |
| + private: |
| + // Fills the passed dictionary with the values to be passed to the template |
| + // when creating the HTML. |
| + void PopulateExtendedReportingOption(base::DictionaryValue* load_time_data); |
| + void PopulateMalwareLoadTimeData(base::DictionaryValue* load_time_data); |
| + void PopulateHarmfulLoadTimeData(base::DictionaryValue* load_time_data); |
| + void PopulatePhishingLoadTimeData(base::DictionaryValue* load_time_data); |
| + |
| + const GURL request_url_; |
| + const GURL main_frame_url_; |
| + const BaseSafeBrowsingErrorUI::SBInterstitialReason interstitial_reason_; |
| + BaseSafeBrowsingErrorUI::SBErrorDisplayOptions display_options_; |
| + const std::string app_locale_; |
| + const base::Time time_triggered_; |
| + |
| + ControllerClient* controller_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(SafeBrowsingLoudErrorUI); |
| +}; |
| + |
| +} // security_interstitials |
| + |
| +#endif // COMPONENTS_SECURITY_INTERSTITIALS_CORE_SAFE_BROWSING_LOUD_ERROR_UI_H_ |