112 lines
4 KiB
Diff
112 lines
4 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: deepak1556 <hop2deep@gmail.com>
|
|
Date: Thu, 20 Sep 2018 17:50:34 -0700
|
|
Subject: ssl_security_state_tab_helper.patch
|
|
|
|
Allows populating security tab info for devtools in Electron.
|
|
|
|
diff --git a/chrome/browser/ssl/security_state_tab_helper.cc b/chrome/browser/ssl/security_state_tab_helper.cc
|
|
index 810fdd18c25a3d3abf13b163e8e63b201d3736e9..0c678efd12694b2f5bd3969f9ad7d1adf4ef4a72 100644
|
|
--- a/chrome/browser/ssl/security_state_tab_helper.cc
|
|
+++ b/chrome/browser/ssl/security_state_tab_helper.cc
|
|
@@ -7,6 +7,7 @@
|
|
#include <string>
|
|
|
|
#include "base/bind.h"
|
|
+#include "base/command_line.h"
|
|
#include "base/feature_list.h"
|
|
#include "base/metrics/field_trial_params.h"
|
|
#include "base/metrics/histogram_macros.h"
|
|
@@ -14,24 +15,28 @@
|
|
#include "base/strings/string_util.h"
|
|
#include "build/build_config.h"
|
|
#include "build/chromeos_buildflags.h"
|
|
+#if 0
|
|
#include "chrome/browser/browser_process.h"
|
|
#include "chrome/browser/profiles/profile.h"
|
|
#include "chrome/browser/reputation/reputation_web_contents_observer.h"
|
|
#include "chrome/browser/safe_browsing/safe_browsing_service.h"
|
|
#include "chrome/browser/safe_browsing/ui_manager.h"
|
|
#include "chrome/browser/ssl/known_interception_disclosure_infobar_delegate.h"
|
|
+#endif
|
|
#include "chrome/common/chrome_features.h"
|
|
#include "chrome/common/chrome_switches.h"
|
|
#include "chrome/common/pref_names.h"
|
|
#include "chrome/common/secure_origin_allowlist.h"
|
|
#include "components/autofill/core/common/autofill_features.h"
|
|
+#if 0
|
|
#include "components/omnibox/browser/omnibox_field_trial.h"
|
|
#include "components/omnibox/common/omnibox_features.h"
|
|
#include "components/password_manager/core/browser/password_manager_metrics_util.h"
|
|
-#include "components/prefs/pref_service.h"
|
|
#include "components/safe_browsing/buildflags.h"
|
|
#include "components/security_interstitials/core/features.h"
|
|
#include "components/security_interstitials/core/pref_names.h"
|
|
+#endif
|
|
+#include "components/prefs/pref_service.h"
|
|
#include "components/security_state/content/content_utils.h"
|
|
#include "content/public/browser/browser_context.h"
|
|
#include "content/public/browser/navigation_entry.h"
|
|
@@ -54,7 +59,7 @@
|
|
#include "chrome/browser/chromeos/policy/policy_cert_service_factory.h"
|
|
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
|
|
|
|
-#if BUILDFLAG(FULL_SAFE_BROWSING)
|
|
+#if 0
|
|
#include "chrome/browser/safe_browsing/chrome_password_protection_service.h"
|
|
#endif
|
|
|
|
@@ -76,8 +81,9 @@ void RecordSecurityLevel(
|
|
|
|
} // namespace
|
|
|
|
+#if 0
|
|
using password_manager::metrics_util::PasswordType;
|
|
-using safe_browsing::SafeBrowsingUIManager;
|
|
+#endif
|
|
|
|
SecurityStateTabHelper::SecurityStateTabHelper(
|
|
content::WebContents* web_contents)
|
|
@@ -101,6 +107,7 @@ SecurityStateTabHelper::GetVisibleSecurityState() {
|
|
// information is still being initialized, thus no need to check for that.
|
|
state->malicious_content_status = GetMaliciousContentStatus();
|
|
|
|
+#if 0
|
|
ReputationWebContentsObserver* reputation_web_contents_observer =
|
|
ReputationWebContentsObserver::FromWebContents(web_contents());
|
|
state->safety_tip_info =
|
|
@@ -125,6 +132,7 @@ SecurityStateTabHelper::GetVisibleSecurityState() {
|
|
}
|
|
}
|
|
|
|
+#endif
|
|
return state;
|
|
}
|
|
|
|
@@ -184,8 +192,10 @@ void SecurityStateTabHelper::DidFinishNavigation(
|
|
UMA_HISTOGRAM_BOOLEAN("interstitial.ssl.visited_site_after_warning", true);
|
|
}
|
|
|
|
+#if 0
|
|
MaybeShowKnownInterceptionDisclosureDialog(
|
|
web_contents(), visible_security_state->cert_status);
|
|
+#endif
|
|
}
|
|
|
|
void SecurityStateTabHelper::DidChangeVisibleSecurityState() {
|
|
@@ -209,6 +219,7 @@ SecurityStateTabHelper::GetMaliciousContentStatus() const {
|
|
web_contents()->GetController().GetVisibleEntry();
|
|
if (!entry)
|
|
return security_state::MALICIOUS_CONTENT_STATUS_NONE;
|
|
+#if 0
|
|
safe_browsing::SafeBrowsingService* sb_service =
|
|
g_browser_process->safe_browsing_service();
|
|
if (!sb_service)
|
|
@@ -291,6 +302,7 @@ SecurityStateTabHelper::GetMaliciousContentStatus() const {
|
|
break;
|
|
}
|
|
}
|
|
+#endif
|
|
return security_state::MALICIOUS_CONTENT_STATUS_NONE;
|
|
}
|
|
|