Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(185)

Unified Diff: components/security_interstitials/core/safe_browsing_error_ui.h

Issue 2603433002: Move SecurityInterstitialPage into component (Closed)
Patch Set: missed some changes in rebase Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/security_interstitials/core/safe_browsing_error_ui.h
diff --git a/components/security_interstitials/core/safe_browsing_error_ui.h b/components/security_interstitials/core/safe_browsing_error_ui.h
index 322edb0dad0362f532eb5dd37d7faaa9e249dfe4..3124ee3bd4ddf3ab9b549c99cc1e4bbbc602d3bb 100644
--- a/components/security_interstitials/core/safe_browsing_error_ui.h
+++ b/components/security_interstitials/core/safe_browsing_error_ui.h
@@ -26,13 +26,15 @@ class SafeBrowsingErrorUI {
struct SBErrorDisplayOptions {
SBErrorDisplayOptions(bool is_main_frame_load_blocked,
- bool can_show_extended_reporting_option,
+ bool is_extended_reporting_opt_in_allowed,
+ bool is_off_the_record,
bool is_extended_reporting_enabled,
bool is_scout_reporting_enabled,
bool is_proceed_anyway_disabled)
: is_main_frame_load_blocked(is_main_frame_load_blocked),
- can_show_extended_reporting_option(
- can_show_extended_reporting_option),
+ is_extended_reporting_opt_in_allowed(
+ is_extended_reporting_opt_in_allowed),
+ is_off_the_record(is_off_the_record),
is_extended_reporting_enabled(is_extended_reporting_enabled),
is_scout_reporting_enabled(is_scout_reporting_enabled),
is_proceed_anyway_disabled(is_proceed_anyway_disabled) {}
@@ -40,8 +42,11 @@ class SafeBrowsingErrorUI {
// Indicates if this SB interstitial is blocking main frame load.
bool is_main_frame_load_blocked;
- // Indicates if we can show extended reporting checkbox,
- bool can_show_extended_reporting_option;
+ // Indicates if user is allowed to opt-in extended reporting preference.
+ bool is_extended_reporting_opt_in_allowed;
+
+ // Indicates if user is in incognito mode.
+ bool is_off_the_record;
// Indicates if user opted in for SB extended reporting.
bool is_extended_reporting_enabled;
@@ -64,10 +69,36 @@ class SafeBrowsingErrorUI {
void PopulateStringsForHTML(base::DictionaryValue* load_time_data);
void HandleCommand(SecurityInterstitialCommands command);
- bool is_main_frame_load_blocked() {
+
+ // 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();
+
+ bool is_main_frame_load_blocked() const {
return display_options_.is_main_frame_load_blocked;
}
+ bool is_extended_reporting_opt_in_allowed() const {
+ return display_options_.is_extended_reporting_opt_in_allowed;
+ }
+
+ bool is_off_the_record() const {
+ return display_options_.is_off_the_record;
+ }
+
+ bool is_extended_reporting_enabled() const {
+ return display_options_.is_extended_reporting_enabled;
+ }
+
+ bool is_proceed_anyway_disabled() const {
+ return display_options_.is_proceed_anyway_disabled;
+ }
+
+ const std::string app_locale() const {
+ return app_locale_;
+ }
+
private:
// Fills the passed dictionary with the values to be passed to the template
// when creating the HTML.

Powered by Google App Engine
This is Rietveld 408576698