123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175 |
- From: csagan5 <32685696+csagan5@users.noreply.github.com>
- Date: Wed, 23 Sep 2020 14:47:44 +0200
- Subject: Password service build fixes
- ---
- .../chrome_password_manager_client.cc | 2 ++
- .../chrome_password_manager_client.h | 10 ++++++++--
- .../chrome_password_protection_service.cc | 20 -------------------
- .../chrome_password_protection_service.h | 2 --
- .../core/browser/password_manager_client.h | 4 ++++
- .../password_reuse_detection_manager.cc | 2 ++
- .../password_protection_request.cc | 2 --
- .../password_protection_service.h | 5 -----
- 8 files changed, 16 insertions(+), 31 deletions(-)
- diff --git a/chrome/browser/password_manager/chrome_password_manager_client.cc b/chrome/browser/password_manager/chrome_password_manager_client.cc
- --- a/chrome/browser/password_manager/chrome_password_manager_client.cc
- +++ b/chrome/browser/password_manager/chrome_password_manager_client.cc
- @@ -471,7 +471,9 @@ void ChromePasswordManagerClient::ShowTouchToFill(
- #if defined(OS_ANDROID)
- void ChromePasswordManagerClient::OnPasswordSelected(
- const base::string16& text) {
- +#if defined(PASSWORD_REUSE_DETECTION_ENABLED)
- password_reuse_detection_manager_.OnPaste(text);
- +#endif
- }
- #endif
-
- diff --git a/chrome/browser/password_manager/chrome_password_manager_client.h b/chrome/browser/password_manager/chrome_password_manager_client.h
- --- a/chrome/browser/password_manager/chrome_password_manager_client.h
- +++ b/chrome/browser/password_manager/chrome_password_manager_client.h
- @@ -190,8 +190,14 @@ class ChromePasswordManagerClient
- void AnnotateNavigationEntry(bool has_password_field) override;
- autofill::LanguageCode GetPageLanguage() const override;
-
- +#if defined(PASSWORD_REUSE_DETECTION_ENABLED)
- +#define PASSWORD_REUSE_DETECTION_ENABLED_OVERRIDE override
- +#else
- +#define PASSWORD_REUSE_DETECTION_ENABLED_OVERRIDE
- +#endif
- +
- safe_browsing::PasswordProtectionService* GetPasswordProtectionService()
- - const override;
- + const PASSWORD_REUSE_DETECTION_ENABLED_OVERRIDE;
-
- #if defined(ON_FOCUS_PING_ENABLED)
- void CheckSafeBrowsingReputation(const GURL& form_action,
- @@ -203,7 +209,7 @@ class ChromePasswordManagerClient
- const std::string& username,
- const std::vector<password_manager::MatchingReusedCredential>&
- matching_reused_credentials,
- - bool password_field_exists) override;
- + bool password_field_exists) PASSWORD_REUSE_DETECTION_ENABLED_OVERRIDE;
-
- void LogPasswordReuseDetectedEvent() override;
-
- diff --git a/chrome/browser/safe_browsing/chrome_password_protection_service.cc b/chrome/browser/safe_browsing/chrome_password_protection_service.cc
- --- a/chrome/browser/safe_browsing/chrome_password_protection_service.cc
- +++ b/chrome/browser/safe_browsing/chrome_password_protection_service.cc
- @@ -353,26 +353,6 @@ bool ChromePasswordProtectionService::ShouldShowPasswordReusePageInfoBubble(
- : false;
- }
-
- -safe_browsing::LoginReputationClientRequest::UrlDisplayExperiment
- -ChromePasswordProtectionService::GetUrlDisplayExperiment() const {
- - safe_browsing::LoginReputationClientRequest::UrlDisplayExperiment experiment;
- - experiment.set_simplified_url_display_enabled(
- - base::FeatureList::IsEnabled(safe_browsing::kSimplifiedUrlDisplay));
- - // Delayed warnings parameters:
- - experiment.set_delayed_warnings_enabled(
- - base::FeatureList::IsEnabled(safe_browsing::kDelayedWarnings));
- - experiment.set_delayed_warnings_mouse_clicks_enabled(
- - safe_browsing::kDelayedWarningsEnableMouseClicks.Get());
- - // Actual URL display experiments:
- - experiment.set_reveal_on_hover(base::FeatureList::IsEnabled(
- - omnibox::kRevealSteadyStateUrlPathQueryAndRefOnHover));
- - experiment.set_hide_on_interaction(base::FeatureList::IsEnabled(
- - omnibox::kHideSteadyStateUrlPathQueryAndRefOnInteraction));
- - experiment.set_elide_to_registrable_domain(
- - base::FeatureList::IsEnabled(omnibox::kMaybeElideToRegistrableDomain));
- - return experiment;
- -}
- -
- void ChromePasswordProtectionService::ShowModalWarning(
- content::WebContents* web_contents,
- RequestOutcome outcome,
- diff --git a/chrome/browser/safe_browsing/chrome_password_protection_service.h b/chrome/browser/safe_browsing/chrome_password_protection_service.h
- --- a/chrome/browser/safe_browsing/chrome_password_protection_service.h
- +++ b/chrome/browser/safe_browsing/chrome_password_protection_service.h
- @@ -256,8 +256,6 @@ class ChromePasswordProtectionService : public PasswordProtectionService {
- // |NOT_SIGNED_IN|.
- LoginReputationClientRequest::PasswordReuseEvent::SyncAccountType
- GetSyncAccountType() const override;
- - safe_browsing::LoginReputationClientRequest::UrlDisplayExperiment
- - GetUrlDisplayExperiment() const override;
-
- // Stores |verdict| in the cache based on its |trigger_type|, |url|,
- // reused |password_type|, |verdict| and |receive_time|.
- diff --git a/components/password_manager/core/browser/password_manager_client.h b/components/password_manager/core/browser/password_manager_client.h
- --- a/components/password_manager/core/browser/password_manager_client.h
- +++ b/components/password_manager/core/browser/password_manager_client.h
- @@ -330,9 +330,11 @@ class PasswordManagerClient {
- // Returns the current best guess as to the page's display language.
- virtual autofill::LanguageCode GetPageLanguage() const;
-
- +#if defined(PASSWORD_REUSE_DETECTION_ENABLED)
- // Return the PasswordProtectionService associated with this instance.
- virtual safe_browsing::PasswordProtectionService*
- GetPasswordProtectionService() const = 0;
- +#endif
-
- #if defined(ON_FOCUS_PING_ENABLED)
- // Checks the safe browsing reputation of the webpage when the
- @@ -342,6 +344,7 @@ class PasswordManagerClient {
- const GURL& frame_url) = 0;
- #endif
-
- +#if defined(PASSWORD_REUSE_DETECTION_ENABLED)
- // Checks the safe browsing reputation of the webpage where password reuse
- // happens. This is called by the PasswordReuseDetectionManager when a
- // protected password is typed on the wrong domain. This may trigger a
- @@ -354,6 +357,7 @@ class PasswordManagerClient {
- const std::string& username,
- const std::vector<MatchingReusedCredential>& matching_reused_credentials,
- bool password_field_exists) = 0;
- +#endif
-
- // Records a Chrome Sync event that GAIA password reuse was detected.
- virtual void LogPasswordReuseDetectedEvent() = 0;
- diff --git a/components/password_manager/core/browser/password_reuse_detection_manager.cc b/components/password_manager/core/browser/password_reuse_detection_manager.cc
- --- a/components/password_manager/core/browser/password_reuse_detection_manager.cc
- +++ b/components/password_manager/core/browser/password_reuse_detection_manager.cc
- @@ -170,10 +170,12 @@ void PasswordReuseDetectionManager::OnReuseCheckDone(
- ? reused_protected_password_hash->username
- : "";
-
- +#if defined(PASSWORD_REUSE_DETECTION_ENABLED)
- client_->CheckProtectedPasswordEntry(
- reused_password_type, username,
- std::move(all_matching_reused_credentials_).extract(),
- password_field_detected);
- +#endif
-
- all_matching_reused_credentials_.clear();
- }
- diff --git a/components/safe_browsing/content/password_protection/password_protection_request.cc b/components/safe_browsing/content/password_protection/password_protection_request.cc
- --- a/components/safe_browsing/content/password_protection/password_protection_request.cc
- +++ b/components/safe_browsing/content/password_protection/password_protection_request.cc
- @@ -137,8 +137,6 @@ PasswordProtectionRequest::PasswordProtectionRequest(
- password_type_ != PasswordType::SAVED_PASSWORD ||
- !matching_reused_credentials_.empty());
- request_proto_->set_trigger_type(trigger_type_);
- - *request_proto_->mutable_url_display_experiment() =
- - pps->GetUrlDisplayExperiment();
-
- request_canceler_ =
- RequestCanceler::CreateRequestCanceler(GetWeakPtr(), web_contents);
- diff --git a/components/safe_browsing/content/password_protection/password_protection_service.h b/components/safe_browsing/content/password_protection/password_protection_service.h
- --- a/components/safe_browsing/content/password_protection/password_protection_service.h
- +++ b/components/safe_browsing/content/password_protection/password_protection_service.h
- @@ -411,11 +411,6 @@ class PasswordProtectionServiceBase : public history::HistoryServiceObserver {
- virtual LoginReputationClientRequest::PasswordReuseEvent::SyncAccountType
- GetSyncAccountType() const = 0;
-
- - // Get information about Delayed Warnings and Omnibox URL display experiments.
- - // This information is sent in PhishGuard pings.
- - virtual LoginReputationClientRequest::UrlDisplayExperiment
- - GetUrlDisplayExperiment() const = 0;
- -
- // Returns the reason why a ping is not sent based on the |trigger_type|,
- // |url| and |password_type|. Crash if |CanSendPing| is true.
- virtual RequestOutcome GetPingNotSentReason(
- --
- 2.17.1
|