ssl_security_state_tab_helper.patch 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
  2. From: deepak1556 <[email protected]>
  3. Date: Thu, 20 Sep 2018 17:50:34 -0700
  4. Subject: ssl_security_state_tab_helper.patch
  5. Allows populating security tab info for devtools in Electron.
  6. diff --git a/chrome/browser/ssl/security_state_tab_helper.cc b/chrome/browser/ssl/security_state_tab_helper.cc
  7. index 952866cd71b8d191f102e50857e3008b03756321..9f1f029f8e25139200272be8ea3661ce871f885a 100644
  8. --- a/chrome/browser/ssl/security_state_tab_helper.cc
  9. +++ b/chrome/browser/ssl/security_state_tab_helper.cc
  10. @@ -7,6 +7,7 @@
  11. #include <string>
  12. #include "base/bind.h"
  13. +#include "base/command_line.h"
  14. #include "base/feature_list.h"
  15. #include "base/metrics/field_trial_params.h"
  16. #include "base/metrics/histogram_macros.h"
  17. @@ -14,24 +15,28 @@
  18. #include "base/strings/string_util.h"
  19. #include "build/build_config.h"
  20. #include "build/chromeos_buildflags.h"
  21. +#if 0
  22. #include "chrome/browser/browser_process.h"
  23. #include "chrome/browser/profiles/profile.h"
  24. #include "chrome/browser/reputation/reputation_web_contents_observer.h"
  25. #include "chrome/browser/safe_browsing/safe_browsing_service.h"
  26. #include "chrome/browser/safe_browsing/ui_manager.h"
  27. #include "chrome/browser/ssl/known_interception_disclosure_infobar_delegate.h"
  28. +#endif
  29. #include "chrome/common/chrome_features.h"
  30. #include "chrome/common/chrome_switches.h"
  31. #include "chrome/common/pref_names.h"
  32. #include "chrome/common/secure_origin_allowlist.h"
  33. #include "components/autofill/core/common/autofill_features.h"
  34. +#if 0
  35. #include "components/omnibox/browser/omnibox_field_trial.h"
  36. #include "components/omnibox/common/omnibox_features.h"
  37. #include "components/password_manager/core/browser/password_manager_metrics_util.h"
  38. -#include "components/prefs/pref_service.h"
  39. #include "components/safe_browsing/buildflags.h"
  40. #include "components/security_interstitials/core/features.h"
  41. #include "components/security_interstitials/core/pref_names.h"
  42. +#endif
  43. +#include "components/prefs/pref_service.h"
  44. #include "components/security_state/content/content_utils.h"
  45. #include "content/public/browser/browser_context.h"
  46. #include "content/public/browser/navigation_entry.h"
  47. @@ -54,7 +59,7 @@
  48. #include "chrome/browser/chromeos/policy/policy_cert_service_factory.h"
  49. #endif // BUILDFLAG(IS_CHROMEOS_ASH)
  50. -#if BUILDFLAG(FULL_SAFE_BROWSING)
  51. +#if 0
  52. #include "chrome/browser/safe_browsing/chrome_password_protection_service.h"
  53. #endif
  54. @@ -76,8 +81,9 @@ void RecordSecurityLevel(
  55. } // namespace
  56. +#if 0
  57. using password_manager::metrics_util::PasswordType;
  58. -using safe_browsing::SafeBrowsingUIManager;
  59. +#endif
  60. SecurityStateTabHelper::SecurityStateTabHelper(
  61. content::WebContents* web_contents)
  62. @@ -101,6 +107,7 @@ SecurityStateTabHelper::GetVisibleSecurityState() {
  63. // information is still being initialized, thus no need to check for that.
  64. state->malicious_content_status = GetMaliciousContentStatus();
  65. +#if 0
  66. ReputationWebContentsObserver* reputation_web_contents_observer =
  67. ReputationWebContentsObserver::FromWebContents(web_contents());
  68. state->safety_tip_info =
  69. @@ -125,6 +132,7 @@ SecurityStateTabHelper::GetVisibleSecurityState() {
  70. }
  71. }
  72. +#endif
  73. return state;
  74. }
  75. @@ -184,8 +192,10 @@ void SecurityStateTabHelper::DidFinishNavigation(
  76. UMA_HISTOGRAM_BOOLEAN("interstitial.ssl.visited_site_after_warning", true);
  77. }
  78. +#if 0
  79. MaybeShowKnownInterceptionDisclosureDialog(
  80. web_contents(), visible_security_state->cert_status);
  81. +#endif
  82. }
  83. void SecurityStateTabHelper::DidChangeVisibleSecurityState() {
  84. @@ -209,6 +219,7 @@ SecurityStateTabHelper::GetMaliciousContentStatus() const {
  85. web_contents()->GetController().GetVisibleEntry();
  86. if (!entry)
  87. return security_state::MALICIOUS_CONTENT_STATUS_NONE;
  88. +#if 0
  89. safe_browsing::SafeBrowsingService* sb_service =
  90. g_browser_process->safe_browsing_service();
  91. if (!sb_service)
  92. @@ -287,6 +298,7 @@ SecurityStateTabHelper::GetMaliciousContentStatus() const {
  93. break;
  94. }
  95. }
  96. +#endif
  97. return security_state::MALICIOUS_CONTENT_STATUS_NONE;
  98. }