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-04-20 17:20:37 +00:00
|
|
|
index aef4333e3d769d26b71822294d5f2fcedf3141c5..fe3d44e33213daa89f6ea5f4f84103686db6aece 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-02-26 21:31:29 +00:00
|
|
|
@@ -12,10 +12,12 @@
|
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"
|
|
|
|
#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/chrome_switches.h"
|
|
|
|
#include "chrome/common/pref_names.h"
|
|
|
|
#include "chrome/common/secure_origin_whitelist.h"
|
2019-03-21 22:45:52 +00:00
|
|
|
@@ -45,8 +47,10 @@
|
2018-09-14 05:02:16 +00:00
|
|
|
#endif // defined(OS_CHROMEOS)
|
|
|
|
|
2019-03-21 22:45:52 +00:00
|
|
|
#if defined(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-03-21 22:45:52 +00:00
|
|
|
+#endif
|
|
|
|
|
|
|
|
namespace {
|
2018-09-14 05:02:16 +00:00
|
|
|
|
2019-03-21 22:45:52 +00:00
|
|
|
@@ -82,7 +86,9 @@ bool IsOriginSecureWithWhitelist(
|
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
|
|
|
|
using safe_browsing::SafeBrowsingUIManager;
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
SecurityStateTabHelper::SecurityStateTabHelper(
|
|
|
|
content::WebContents* web_contents)
|
2019-04-20 17:20:37 +00:00
|
|
|
@@ -149,6 +155,7 @@ void SecurityStateTabHelper::DidFinishNavigation(
|
2018-09-14 05:02:16 +00:00
|
|
|
UMA_HISTOGRAM_BOOLEAN("interstitial.ssl.visited_site_after_warning", true);
|
|
|
|
}
|
|
|
|
|
|
|
|
+#if 0
|
|
|
|
// Security indicator UI study (https://crbug.com/803501): Show a message in
|
|
|
|
// the console to reduce developer confusion about the experimental UI
|
|
|
|
// treatments for HTTPS pages with EV certificates.
|
2019-04-20 17:20:37 +00:00
|
|
|
@@ -176,6 +183,7 @@ void SecurityStateTabHelper::DidFinishNavigation(
|
2018-09-14 05:02:16 +00:00
|
|
|
"Validation is still valid.");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
+#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
void SecurityStateTabHelper::DidChangeVisibleSecurityState() {
|
2019-04-20 17:20:37 +00:00
|
|
|
@@ -199,6 +207,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-04-20 17:20:37 +00:00
|
|
|
@@ -266,6 +275,7 @@ SecurityStateTabHelper::GetMaliciousContentStatus() const {
|
2018-09-14 05:02:16 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
+#endif
|
|
|
|
return security_state::MALICIOUS_CONTENT_STATUS_NONE;
|
|
|
|
}
|
|
|
|
|
2019-04-20 17:20:37 +00:00
|
|
|
@@ -273,16 +283,20 @@ std::vector<std::string> SecurityStateTabHelper::GetSecureOriginsAndPatterns()
|
2018-09-14 18:03:43 +00:00
|
|
|
const {
|
|
|
|
const base::CommandLine& command_line =
|
|
|
|
*base::CommandLine::ForCurrentProcess();
|
|
|
|
+#if 0
|
|
|
|
Profile* profile =
|
|
|
|
Profile::FromBrowserContext(web_contents()->GetBrowserContext());
|
|
|
|
PrefService* prefs = profile->GetPrefs();
|
|
|
|
+#endif
|
|
|
|
std::string origins_str = "";
|
2019-03-21 22:45:52 +00:00
|
|
|
if (command_line.HasSwitch(
|
|
|
|
network::switches::kUnsafelyTreatInsecureOriginAsSecure)) {
|
2018-09-14 18:03:43 +00:00
|
|
|
origins_str = command_line.GetSwitchValueASCII(
|
2019-03-21 22:45:52 +00:00
|
|
|
network::switches::kUnsafelyTreatInsecureOriginAsSecure);
|
2018-09-14 18:03:43 +00:00
|
|
|
+#if 0
|
|
|
|
} else if (prefs->HasPrefPath(prefs::kUnsafelyTreatInsecureOriginAsSecure)) {
|
|
|
|
origins_str = prefs->GetString(prefs::kUnsafelyTreatInsecureOriginAsSecure);
|
|
|
|
+#endif
|
|
|
|
}
|
2019-03-21 22:45:52 +00:00
|
|
|
return network::ParseSecureOriginAllowlist(origins_str);
|
2018-09-14 18:03:43 +00:00
|
|
|
}
|