2018-10-24 18:24:11 +00:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
2018-09-21 00:30:26 +00:00
|
|
|
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.
|
|
|
|
|
2018-09-14 05:02:16 +00:00
|
|
|
diff --git a/chrome/browser/ssl/security_state_tab_helper.cc b/chrome/browser/ssl/security_state_tab_helper.cc
|
2019-08-24 01:14:23 +00:00
|
|
|
index 26ec105bf873bd0e802c2c7e65e5e82f2abcfd85..b5e94e434ad7c22de2b59ae1bd0640d55da690a2 100644
|
2018-09-14 05:02:16 +00:00
|
|
|
--- a/chrome/browser/ssl/security_state_tab_helper.cc
|
|
|
|
+++ b/chrome/browser/ssl/security_state_tab_helper.cc
|
2019-08-15 20:50:58 +00:00
|
|
|
@@ -13,16 +13,20 @@
|
2019-01-16 18:07:52 +00:00
|
|
|
#include "base/strings/pattern.h"
|
2018-09-14 18:03:43 +00:00
|
|
|
#include "base/strings/string_util.h"
|
2018-09-14 05:02:16 +00:00
|
|
|
#include "build/build_config.h"
|
|
|
|
+#if 0
|
|
|
|
#include "chrome/browser/browser_process.h"
|
2019-08-15 20:50:58 +00:00
|
|
|
#include "chrome/browser/lookalikes/safety_tips/reputation_web_contents_observer.h"
|
2018-09-14 05:02:16 +00:00
|
|
|
#include "chrome/browser/profiles/profile.h"
|
|
|
|
#include "chrome/browser/safe_browsing/safe_browsing_service.h"
|
|
|
|
#include "chrome/browser/safe_browsing/ui_manager.h"
|
|
|
|
+#endif
|
2018-09-14 18:03:43 +00:00
|
|
|
#include "chrome/common/secure_origin_whitelist.h"
|
2019-05-28 20:18:10 +00:00
|
|
|
+#if 0
|
2019-05-13 18:49:01 +00:00
|
|
|
#include "components/omnibox/browser/omnibox_field_trial.h"
|
|
|
|
#include "components/omnibox/common/omnibox_features.h"
|
2019-07-03 01:22:09 +00:00
|
|
|
#include "components/password_manager/core/browser/password_manager_metrics_util.h"
|
2019-08-02 23:56:46 +00:00
|
|
|
#include "components/safe_browsing/buildflags.h"
|
2019-05-28 20:18:10 +00:00
|
|
|
+#endif
|
|
|
|
#include "components/security_state/content/content_utils.h"
|
|
|
|
#include "content/public/browser/browser_context.h"
|
|
|
|
#include "content/public/browser/navigation_entry.h"
|
2019-08-15 20:50:58 +00:00
|
|
|
@@ -44,7 +48,7 @@
|
2019-08-02 23:56:46 +00:00
|
|
|
#include "chrome/browser/chromeos/policy/policy_cert_service_factory.h"
|
2018-09-14 05:02:16 +00:00
|
|
|
#endif // defined(OS_CHROMEOS)
|
|
|
|
|
2019-08-02 23:56:46 +00:00
|
|
|
-#if BUILDFLAG(FULL_SAFE_BROWSING)
|
2018-09-14 05:02:16 +00:00
|
|
|
+#if 0
|
|
|
|
#include "chrome/browser/safe_browsing/chrome_password_protection_service.h"
|
|
|
|
#endif
|
|
|
|
|
2019-08-15 20:50:58 +00:00
|
|
|
@@ -64,6 +68,7 @@ void RecordSecurityLevel(
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
+#if 0
|
|
|
|
security_state::SafetyTipStatus GetSecurityStateSafetyTipType(
|
|
|
|
safety_tips::SafetyTipType type) {
|
|
|
|
switch (type) {
|
|
|
|
@@ -76,11 +81,13 @@ security_state::SafetyTipStatus GetSecurityStateSafetyTipType(
|
|
|
|
return security_state::SafetyTipStatus::SAFETY_TIP_STATUS_NONE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
+#endif
|
2018-09-14 05:02:16 +00:00
|
|
|
|
2018-10-24 23:25:48 +00:00
|
|
|
} // namespace
|
2018-09-14 05:02:16 +00:00
|
|
|
|
|
|
|
+#if 0
|
2019-07-03 01:22:09 +00:00
|
|
|
using password_manager::metrics_util::PasswordType;
|
|
|
|
-using safe_browsing::SafeBrowsingUIManager;
|
2018-09-14 05:02:16 +00:00
|
|
|
+#endif
|
|
|
|
|
|
|
|
SecurityStateTabHelper::SecurityStateTabHelper(
|
|
|
|
content::WebContents* web_contents)
|
2019-08-15 20:50:58 +00:00
|
|
|
@@ -102,6 +109,7 @@ SecurityStateTabHelper::GetVisibleSecurityState() const {
|
|
|
|
// information is still being initialized, thus no need to check for that.
|
|
|
|
state->malicious_content_status = GetMaliciousContentStatus();
|
|
|
|
|
|
|
|
+#if 0
|
|
|
|
safety_tips::ReputationWebContentsObserver* reputation_web_contents_observer =
|
|
|
|
safety_tips::ReputationWebContentsObserver::FromWebContents(
|
|
|
|
web_contents());
|
|
|
|
@@ -110,6 +118,7 @@ SecurityStateTabHelper::GetVisibleSecurityState() const {
|
|
|
|
? GetSecurityStateSafetyTipType(
|
|
|
|
reputation_web_contents_observer->last_shown_safety_tip_type())
|
|
|
|
: security_state::SafetyTipStatus::SAFETY_TIP_STATUS_NONE;
|
|
|
|
+#endif
|
|
|
|
return state;
|
|
|
|
}
|
|
|
|
|
|
|
|
@@ -176,6 +185,7 @@ SecurityStateTabHelper::GetMaliciousContentStatus() const {
|
2018-09-14 05:02:16 +00:00
|
|
|
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)
|
2019-08-24 01:14:23 +00:00
|
|
|
@@ -254,6 +264,7 @@ SecurityStateTabHelper::GetMaliciousContentStatus() const {
|
2018-09-14 05:02:16 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
+#endif
|
|
|
|
return security_state::MALICIOUS_CONTENT_STATUS_NONE;
|
|
|
|
}
|
|
|
|
|