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

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

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.cc
diff --git a/components/security_interstitials/core/safe_browsing_error_ui.cc b/components/security_interstitials/core/safe_browsing_error_ui.cc
index 44bd274eb673f682a4f8c2bfb7f317fa83eeb4d3..986892c45aad59290e2f99d4124684ddd852aa95 100644
--- a/components/security_interstitials/core/safe_browsing_error_ui.cc
+++ b/components/security_interstitials/core/safe_browsing_error_ui.cc
@@ -217,6 +217,10 @@ void SafeBrowsingErrorUI::HandleCommand(SecurityInterstitialCommands command) {
}
}
+bool SafeBrowsingErrorUI::CanShowExtendedReportingOption() {
+ return !is_off_the_record() && is_extended_reporting_opt_in_allowed();
+}
+
void SafeBrowsingErrorUI::PopulateMalwareLoadTimeData(
base::DictionaryValue* load_time_data) {
load_time_data->SetBoolean("phishing", false);
@@ -284,10 +288,10 @@ void SafeBrowsingErrorUI::PopulatePhishingLoadTimeData(
void SafeBrowsingErrorUI::PopulateExtendedReportingOption(
base::DictionaryValue* load_time_data) {
- load_time_data->SetBoolean(
- security_interstitials::kDisplayCheckBox,
- display_options_.can_show_extended_reporting_option);
- if (!display_options_.can_show_extended_reporting_option)
+ bool can_show_extended_reporting_option = CanShowExtendedReportingOption();
+ load_time_data->SetBoolean(security_interstitials::kDisplayCheckBox,
+ can_show_extended_reporting_option);
+ if (!can_show_extended_reporting_option)
return;
const std::string privacy_link = base::StringPrintf(

Powered by Google App Engine
This is Rietveld 408576698