OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_FORM_FETCHER_H_ | 5 #ifndef COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_FORM_FETCHER_H_ |
6 #define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_FORM_FETCHER_H_ | 6 #define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_FORM_FETCHER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 | 64 |
65 // Statistics for recent password bubble usage. | 65 // Statistics for recent password bubble usage. |
66 virtual const std::vector<InteractionsStats>& GetInteractionsStats() | 66 virtual const std::vector<InteractionsStats>& GetInteractionsStats() |
67 const = 0; | 67 const = 0; |
68 | 68 |
69 // Federated matches obtained from the backend. Valid only if GetState() | 69 // Federated matches obtained from the backend. Valid only if GetState() |
70 // returns NOT_WAITING. | 70 // returns NOT_WAITING. |
71 virtual const std::vector<const autofill::PasswordForm*>& | 71 virtual const std::vector<const autofill::PasswordForm*>& |
72 GetFederatedMatches() const = 0; | 72 GetFederatedMatches() const = 0; |
73 | 73 |
74 // When this instance fetches forms for an HTTP origin: Returns credentials, | 74 // The following accessors return various kinds of `suppressed` credentials. |
75 // if any, found for the HTTPS version of that origin. These results are | 75 // These are stored credentials that are not (auto-)filled, because they are |
76 // queried on a best-effort basis, might be somewhat stale, and are normally | 76 // for an origin that is similar to, but not exactly matching the origin that |
77 // available shortly after the first Consumer::ProcessMatches callback. | 77 // this FormFetcher was created for. They are used for recording metrics on |
| 78 // how often such -- potentially, but not necessarily related -- credentials |
| 79 // are not offered to the user, unduly increasing log-in friction. |
78 // | 80 // |
79 // When there exists no precisely matching HTTP credentials for an origin, but | 81 // There are currently three kinds of suppressed credentials: |
80 // there are suppressed HTTPS credentials, that could indicate a premature | 82 // 1.) HTTPS credentials not filled on the HTTP version of the origin. |
81 // `move-to-HTTPS` migration, or simply that the site serves its sign-up or | 83 // 2.) PSL-matches that are not auto-filled (but filled on account select). |
82 // some of its sign-in forms over HTTPS, while others still over HTTP. | 84 // 3.) Same-organization name credentials, not filled. |
| 85 // |
| 86 // Results below are queried on a best-effort basis, might be somewhat stale, |
| 87 // and are available shortly after the Consumer::ProcessMatches callback. |
| 88 |
| 89 // When this instance fetches forms for an HTTP origin: Returns saved |
| 90 // credentials, if any, found for the HTTPS version of that origin. Empty |
| 91 // otherwise. |
83 virtual const std::vector<const autofill::PasswordForm*>& | 92 virtual const std::vector<const autofill::PasswordForm*>& |
84 GetSuppressedHTTPSForms() const = 0; | 93 GetSuppressedHTTPSForms() const = 0; |
85 | 94 |
86 // Whether querying the results for GetSuppressedHTTPSForms was attempted and | 95 // Returns saved credentials, if any, for PSL-matching origins. Autofilling |
87 // did complete at least once during the lifetime of this instance, regardless | 96 // these is suppressed, however, they *can be* filled on account select. |
88 // of whether there have been any suppressed HTTPS forms. | 97 virtual const std::vector<const autofill::PasswordForm*>& |
89 virtual bool DidCompleteQueryingSuppressedHTTPSForms() const = 0; | 98 GetSuppressedPSLMatchingForms() const = 0; |
| 99 |
| 100 // Returns saved credentials, if any, found for HTTP/HTTPS origins with the |
| 101 // same organization name as the origin this FormFetcher was created for. |
| 102 virtual const std::vector<const autofill::PasswordForm*>& |
| 103 GetSuppressedSameOrganizationNameForms() const = 0; |
| 104 |
| 105 // Whether querying suppressed forms (of all flavors) was attempted and did |
| 106 // complete at least once during the lifetime of this instance, regardless of |
| 107 // whether there have been any results. |
| 108 virtual bool DidCompleteQueryingSuppressedForms() const = 0; |
90 | 109 |
91 // Fetches stored matching logins. In addition the statistics is fetched on | 110 // Fetches stored matching logins. In addition the statistics is fetched on |
92 // platforms with the password bubble. This is called automatically during | 111 // platforms with the password bubble. This is called automatically during |
93 // construction and can be called manually later as well to cause an update | 112 // construction and can be called manually later as well to cause an update |
94 // of the cached credentials. | 113 // of the cached credentials. |
95 virtual void Fetch() = 0; | 114 virtual void Fetch() = 0; |
96 | 115 |
97 // Creates a copy of |*this| with contains the same credentials without the | 116 // Creates a copy of |*this| with contains the same credentials without the |
98 // need for calling Fetch(). Only call this if GetState() returns NOT_WAITING, | 117 // need for calling Fetch(). Only call this if GetState() returns NOT_WAITING, |
99 // otherwise the original FormFetcher does not have any data to be cloned. | 118 // otherwise the original FormFetcher does not have any data to be cloned. |
100 virtual std::unique_ptr<FormFetcher> Clone() = 0; | 119 virtual std::unique_ptr<FormFetcher> Clone() = 0; |
101 | 120 |
102 private: | 121 private: |
103 DISALLOW_COPY_AND_ASSIGN(FormFetcher); | 122 DISALLOW_COPY_AND_ASSIGN(FormFetcher); |
104 }; | 123 }; |
105 | 124 |
106 } // namespace password_manager | 125 } // namespace password_manager |
107 | 126 |
108 #endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_FORM_FETCHER_H_ | 127 #endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_FORM_FETCHER_H_ |
OLD | NEW |