Chromium Code Reviews| Index: components/password_manager/core/browser/form_fetcher_impl.h |
| diff --git a/components/password_manager/core/browser/form_fetcher_impl.h b/components/password_manager/core/browser/form_fetcher_impl.h |
| index a29a66bb5379fb8ab567d1abdc4c93d29a410471..ec5c961448d41005c7d7745caf9389c4914dca43 100644 |
| --- a/components/password_manager/core/browser/form_fetcher_impl.h |
| +++ b/components/password_manager/core/browser/form_fetcher_impl.h |
| @@ -14,7 +14,7 @@ |
| #include "components/password_manager/core/browser/http_password_store_migrator.h" |
| #include "components/password_manager/core/browser/password_store.h" |
| #include "components/password_manager/core/browser/password_store_consumer.h" |
| -#include "components/password_manager/core/browser/suppressed_https_form_fetcher.h" |
| +#include "components/password_manager/core/browser/suppressed_form_fetcher.h" |
| namespace password_manager { |
| @@ -25,14 +25,14 @@ class PasswordManagerClient; |
| class FormFetcherImpl : public FormFetcher, |
| public PasswordStoreConsumer, |
| public HttpPasswordStoreMigrator::Consumer, |
| - public SuppressedHTTPSFormFetcher::Consumer { |
| + public SuppressedFormFetcher::Consumer { |
| public: |
| // |form_digest| describes what credentials need to be retrieved and |
| // |client| serves the PasswordStore, the logging information etc. |
| FormFetcherImpl(PasswordStore::FormDigest form_digest, |
| const PasswordManagerClient* client, |
| bool should_migrate_http_passwords, |
| - bool should_query_suppressed_https_forms); |
| + bool should_query_suppressed_forms); |
| ~FormFetcherImpl() override; |
| @@ -45,7 +45,11 @@ class FormFetcherImpl : public FormFetcher, |
| const override; |
| const std::vector<const autofill::PasswordForm*>& GetSuppressedHTTPSForms() |
| const override; |
| - bool DidCompleteQueryingSuppressedHTTPSForms() const override; |
| + const std::vector<const autofill::PasswordForm*>& |
| + GetSuppressedPSLMatchingForms() const override; |
| + const std::vector<const autofill::PasswordForm*>& |
| + GetSuppressedSameOrganizationNameForms() const override; |
| + bool DidCompleteQueryingSuppressedForms() const override; |
| void Fetch() override; |
| std::unique_ptr<FormFetcher> Clone() override; |
| @@ -58,8 +62,8 @@ class FormFetcherImpl : public FormFetcher, |
| void ProcessMigratedForms( |
| std::vector<std::unique_ptr<autofill::PasswordForm>> forms) override; |
| - // SuppressedHTTPSFormFetcher::Consumer: |
| - void ProcessSuppressedHTTPSForms( |
| + // SuppressedFormFetcher::Consumer: |
| + void ProcessSuppressedForms( |
| std::vector<std::unique_ptr<autofill::PasswordForm>> forms) override; |
| private: |
| @@ -81,19 +85,27 @@ class FormFetcherImpl : public FormFetcher, |
| // Statistics for the current domain. |
| std::vector<InteractionsStats> interactions_stats_; |
| - // When |form_digest_.origin| is not secure, that is, its scheme is HTTP, this |
| - // will be filled with credentials found for the HTTPS version of that origin. |
| - std::vector<std::unique_ptr<autofill::PasswordForm>> suppressed_https_forms_; |
| + std::vector<std::unique_ptr<autofill::PasswordForm>> |
| + suppressed_same_origin_https_forms_; |
| + std::vector<std::unique_ptr<autofill::PasswordForm>> |
| + suppressed_psl_matching_forms_; |
| + std::vector<std::unique_ptr<autofill::PasswordForm>> |
| + suppressed_same_organization_name_forms_; |
| // Whether querying |suppressed_https_forms_| was attempted and did complete |
| // at least once during the lifetime of this instance, regardless of whether |
| // there have been any results. |
| - bool did_complete_querying_suppressed_https_forms_ = false; |
| + bool did_complete_querying_suppressed_forms_ = false; |
| // Non-owning copies of the vectors above. |
| std::vector<const autofill::PasswordForm*> weak_non_federated_; |
| std::vector<const autofill::PasswordForm*> weak_federated_; |
| - std::vector<const autofill::PasswordForm*> weak_suppressed_https_forms_; |
| + std::vector<const autofill::PasswordForm*> |
| + weak_suppressed_same_origin_https_forms_; |
| + std::vector<const autofill::PasswordForm*> |
| + weak_suppressed_psl_matching_forms_; |
| + std::vector<const autofill::PasswordForm*> |
| + weak_suppressed_same_organization_name_forms_; |
| // Consumers of the fetcher, all are assumed to outlive |this|. |
| std::set<FormFetcher::Consumer*> consumers_; |
| @@ -115,16 +127,17 @@ class FormFetcherImpl : public FormFetcher, |
| // Indicates whether HTTP passwords should be migrated to HTTPS. |
| const bool should_migrate_http_passwords_; |
| - // Indicates whether to query |suppressed_https_forms_| on HTTP origins. |
| - const bool should_query_suppressed_https_forms_; |
| + // Indicates whether to query suppressed forms on HTTP/HTTPS origins. |
|
kolos1
2017/05/30 07:02:29
Do we need to mention "HTTP/HTTPS origins"? Sounds
engedy
2017/05/30 08:47:43
Right. Done.
|
| + const bool should_query_suppressed_forms_; |
| // Does the actual migration. |
| std::unique_ptr<HttpPasswordStoreMigrator> http_migrator_; |
| - // When |form_digest_.origin| is not secure, responsible for looking up |
| - // credentials stored for the HTTPS counterpart of that origin. This happens |
| - // asynchronously, without blocking Consumer::ProcessMatches. |
| - std::unique_ptr<SuppressedHTTPSFormFetcher> suppressed_https_form_fetcher_; |
| + // Responsible for looking up `suppressed` credentials. These are stored |
| + // credentials that were not filled, even though they might be related to the |
| + // origin that this instance was created for. Look-up happens asynchronously, |
| + // without blocking Consumer::ProcessMatches. |
| + std::unique_ptr<SuppressedFormFetcher> suppressed_form_fetcher_; |
| DISALLOW_COPY_AND_ASSIGN(FormFetcherImpl); |
| }; |