Password-service-build-fixes.patch 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. From: csagan5 <32685696+csagan5@users.noreply.github.com>
  2. Date: Wed, 23 Sep 2020 14:47:44 +0200
  3. Subject: Password service build fixes
  4. ---
  5. .../chrome_password_manager_client.cc | 2 ++
  6. .../chrome_password_manager_client.h | 10 ++++++++--
  7. .../chrome_password_protection_service.cc | 20 -------------------
  8. .../chrome_password_protection_service.h | 2 --
  9. .../core/browser/password_manager_client.h | 4 ++++
  10. .../password_reuse_detection_manager.cc | 2 ++
  11. .../password_protection_request.cc | 2 --
  12. .../password_protection_service.h | 5 -----
  13. 8 files changed, 16 insertions(+), 31 deletions(-)
  14. diff --git a/chrome/browser/password_manager/chrome_password_manager_client.cc b/chrome/browser/password_manager/chrome_password_manager_client.cc
  15. --- a/chrome/browser/password_manager/chrome_password_manager_client.cc
  16. +++ b/chrome/browser/password_manager/chrome_password_manager_client.cc
  17. @@ -471,7 +471,9 @@ void ChromePasswordManagerClient::ShowTouchToFill(
  18. #if defined(OS_ANDROID)
  19. void ChromePasswordManagerClient::OnPasswordSelected(
  20. const base::string16& text) {
  21. +#if defined(PASSWORD_REUSE_DETECTION_ENABLED)
  22. password_reuse_detection_manager_.OnPaste(text);
  23. +#endif
  24. }
  25. #endif
  26. diff --git a/chrome/browser/password_manager/chrome_password_manager_client.h b/chrome/browser/password_manager/chrome_password_manager_client.h
  27. --- a/chrome/browser/password_manager/chrome_password_manager_client.h
  28. +++ b/chrome/browser/password_manager/chrome_password_manager_client.h
  29. @@ -190,8 +190,14 @@ class ChromePasswordManagerClient
  30. void AnnotateNavigationEntry(bool has_password_field) override;
  31. autofill::LanguageCode GetPageLanguage() const override;
  32. +#if defined(PASSWORD_REUSE_DETECTION_ENABLED)
  33. +#define PASSWORD_REUSE_DETECTION_ENABLED_OVERRIDE override
  34. +#else
  35. +#define PASSWORD_REUSE_DETECTION_ENABLED_OVERRIDE
  36. +#endif
  37. +
  38. safe_browsing::PasswordProtectionService* GetPasswordProtectionService()
  39. - const override;
  40. + const PASSWORD_REUSE_DETECTION_ENABLED_OVERRIDE;
  41. #if defined(ON_FOCUS_PING_ENABLED)
  42. void CheckSafeBrowsingReputation(const GURL& form_action,
  43. @@ -203,7 +209,7 @@ class ChromePasswordManagerClient
  44. const std::string& username,
  45. const std::vector<password_manager::MatchingReusedCredential>&
  46. matching_reused_credentials,
  47. - bool password_field_exists) override;
  48. + bool password_field_exists) PASSWORD_REUSE_DETECTION_ENABLED_OVERRIDE;
  49. void LogPasswordReuseDetectedEvent() override;
  50. diff --git a/chrome/browser/safe_browsing/chrome_password_protection_service.cc b/chrome/browser/safe_browsing/chrome_password_protection_service.cc
  51. --- a/chrome/browser/safe_browsing/chrome_password_protection_service.cc
  52. +++ b/chrome/browser/safe_browsing/chrome_password_protection_service.cc
  53. @@ -353,26 +353,6 @@ bool ChromePasswordProtectionService::ShouldShowPasswordReusePageInfoBubble(
  54. : false;
  55. }
  56. -safe_browsing::LoginReputationClientRequest::UrlDisplayExperiment
  57. -ChromePasswordProtectionService::GetUrlDisplayExperiment() const {
  58. - safe_browsing::LoginReputationClientRequest::UrlDisplayExperiment experiment;
  59. - experiment.set_simplified_url_display_enabled(
  60. - base::FeatureList::IsEnabled(safe_browsing::kSimplifiedUrlDisplay));
  61. - // Delayed warnings parameters:
  62. - experiment.set_delayed_warnings_enabled(
  63. - base::FeatureList::IsEnabled(safe_browsing::kDelayedWarnings));
  64. - experiment.set_delayed_warnings_mouse_clicks_enabled(
  65. - safe_browsing::kDelayedWarningsEnableMouseClicks.Get());
  66. - // Actual URL display experiments:
  67. - experiment.set_reveal_on_hover(base::FeatureList::IsEnabled(
  68. - omnibox::kRevealSteadyStateUrlPathQueryAndRefOnHover));
  69. - experiment.set_hide_on_interaction(base::FeatureList::IsEnabled(
  70. - omnibox::kHideSteadyStateUrlPathQueryAndRefOnInteraction));
  71. - experiment.set_elide_to_registrable_domain(
  72. - base::FeatureList::IsEnabled(omnibox::kMaybeElideToRegistrableDomain));
  73. - return experiment;
  74. -}
  75. -
  76. void ChromePasswordProtectionService::ShowModalWarning(
  77. content::WebContents* web_contents,
  78. RequestOutcome outcome,
  79. diff --git a/chrome/browser/safe_browsing/chrome_password_protection_service.h b/chrome/browser/safe_browsing/chrome_password_protection_service.h
  80. --- a/chrome/browser/safe_browsing/chrome_password_protection_service.h
  81. +++ b/chrome/browser/safe_browsing/chrome_password_protection_service.h
  82. @@ -256,8 +256,6 @@ class ChromePasswordProtectionService : public PasswordProtectionService {
  83. // |NOT_SIGNED_IN|.
  84. LoginReputationClientRequest::PasswordReuseEvent::SyncAccountType
  85. GetSyncAccountType() const override;
  86. - safe_browsing::LoginReputationClientRequest::UrlDisplayExperiment
  87. - GetUrlDisplayExperiment() const override;
  88. // Stores |verdict| in the cache based on its |trigger_type|, |url|,
  89. // reused |password_type|, |verdict| and |receive_time|.
  90. diff --git a/components/password_manager/core/browser/password_manager_client.h b/components/password_manager/core/browser/password_manager_client.h
  91. --- a/components/password_manager/core/browser/password_manager_client.h
  92. +++ b/components/password_manager/core/browser/password_manager_client.h
  93. @@ -330,9 +330,11 @@ class PasswordManagerClient {
  94. // Returns the current best guess as to the page's display language.
  95. virtual autofill::LanguageCode GetPageLanguage() const;
  96. +#if defined(PASSWORD_REUSE_DETECTION_ENABLED)
  97. // Return the PasswordProtectionService associated with this instance.
  98. virtual safe_browsing::PasswordProtectionService*
  99. GetPasswordProtectionService() const = 0;
  100. +#endif
  101. #if defined(ON_FOCUS_PING_ENABLED)
  102. // Checks the safe browsing reputation of the webpage when the
  103. @@ -342,6 +344,7 @@ class PasswordManagerClient {
  104. const GURL& frame_url) = 0;
  105. #endif
  106. +#if defined(PASSWORD_REUSE_DETECTION_ENABLED)
  107. // Checks the safe browsing reputation of the webpage where password reuse
  108. // happens. This is called by the PasswordReuseDetectionManager when a
  109. // protected password is typed on the wrong domain. This may trigger a
  110. @@ -354,6 +357,7 @@ class PasswordManagerClient {
  111. const std::string& username,
  112. const std::vector<MatchingReusedCredential>& matching_reused_credentials,
  113. bool password_field_exists) = 0;
  114. +#endif
  115. // Records a Chrome Sync event that GAIA password reuse was detected.
  116. virtual void LogPasswordReuseDetectedEvent() = 0;
  117. diff --git a/components/password_manager/core/browser/password_reuse_detection_manager.cc b/components/password_manager/core/browser/password_reuse_detection_manager.cc
  118. --- a/components/password_manager/core/browser/password_reuse_detection_manager.cc
  119. +++ b/components/password_manager/core/browser/password_reuse_detection_manager.cc
  120. @@ -170,10 +170,12 @@ void PasswordReuseDetectionManager::OnReuseCheckDone(
  121. ? reused_protected_password_hash->username
  122. : "";
  123. +#if defined(PASSWORD_REUSE_DETECTION_ENABLED)
  124. client_->CheckProtectedPasswordEntry(
  125. reused_password_type, username,
  126. std::move(all_matching_reused_credentials_).extract(),
  127. password_field_detected);
  128. +#endif
  129. all_matching_reused_credentials_.clear();
  130. }
  131. diff --git a/components/safe_browsing/content/password_protection/password_protection_request.cc b/components/safe_browsing/content/password_protection/password_protection_request.cc
  132. --- a/components/safe_browsing/content/password_protection/password_protection_request.cc
  133. +++ b/components/safe_browsing/content/password_protection/password_protection_request.cc
  134. @@ -137,8 +137,6 @@ PasswordProtectionRequest::PasswordProtectionRequest(
  135. password_type_ != PasswordType::SAVED_PASSWORD ||
  136. !matching_reused_credentials_.empty());
  137. request_proto_->set_trigger_type(trigger_type_);
  138. - *request_proto_->mutable_url_display_experiment() =
  139. - pps->GetUrlDisplayExperiment();
  140. request_canceler_ =
  141. RequestCanceler::CreateRequestCanceler(GetWeakPtr(), web_contents);
  142. diff --git a/components/safe_browsing/content/password_protection/password_protection_service.h b/components/safe_browsing/content/password_protection/password_protection_service.h
  143. --- a/components/safe_browsing/content/password_protection/password_protection_service.h
  144. +++ b/components/safe_browsing/content/password_protection/password_protection_service.h
  145. @@ -411,11 +411,6 @@ class PasswordProtectionServiceBase : public history::HistoryServiceObserver {
  146. virtual LoginReputationClientRequest::PasswordReuseEvent::SyncAccountType
  147. GetSyncAccountType() const = 0;
  148. - // Get information about Delayed Warnings and Omnibox URL display experiments.
  149. - // This information is sent in PhishGuard pings.
  150. - virtual LoginReputationClientRequest::UrlDisplayExperiment
  151. - GetUrlDisplayExperiment() const = 0;
  152. -
  153. // Returns the reason why a ping is not sent based on the |trigger_type|,
  154. // |url| and |password_type|. Crash if |CanSendPing| is true.
  155. virtual RequestOutcome GetPingNotSentReason(
  156. --
  157. 2.17.1