Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(451)

Side by Side Diff: components/password_manager/core/browser/fake_form_fetcher.h

Issue 2912783002: Measure how often PSL and same-organization name credentials are suppressed. (Closed)
Patch Set: Addressed comments from kolos@. Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_FAKE_FORM_FETCHER_H_ 5 #ifndef COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_FAKE_FORM_FETCHER_H_
6 #define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_FAKE_FORM_FETCHER_H_ 6 #define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_FAKE_FORM_FETCHER_H_
7 7
8 #include <set> 8 #include <set>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 58
59 const std::vector<const autofill::PasswordForm*>& GetSuppressedHTTPSForms() 59 const std::vector<const autofill::PasswordForm*>& GetSuppressedHTTPSForms()
60 const override; 60 const override;
61 61
62 // The pointees in |suppressed_forms| must outlive the fetcher. 62 // The pointees in |suppressed_forms| must outlive the fetcher.
63 void set_suppressed_https_forms( 63 void set_suppressed_https_forms(
64 const std::vector<const autofill::PasswordForm*>& suppressed_forms) { 64 const std::vector<const autofill::PasswordForm*>& suppressed_forms) {
65 suppressed_https_forms_ = suppressed_forms; 65 suppressed_https_forms_ = suppressed_forms;
66 } 66 }
67 67
68 bool DidCompleteQueryingSuppressedHTTPSForms() const override; 68 const std::vector<const autofill::PasswordForm*>&
69 GetSuppressedPSLMatchingForms() const override;
69 70
70 void set_did_complete_querying_suppressed_https_forms(bool value) { 71 // The pointees in |suppressed_forms| must outlive the fetcher.
71 did_complete_querying_suppressed_https_forms_ = value; 72 void set_suppressed_psl_matching_forms(
73 const std::vector<const autofill::PasswordForm*>& suppressed_forms) {
74 suppressed_psl_matching_forms_ = suppressed_forms;
75 }
76
77 const std::vector<const autofill::PasswordForm*>&
78 GetSuppressedSameOrganizationNameForms() const override;
79
80 // The pointees in |suppressed_forms| must outlive the fetcher.
81 void set_suppressed_same_organization_name_forms(
82 const std::vector<const autofill::PasswordForm*>& suppressed_forms) {
83 suppressed_same_organization_name_forms_ = suppressed_forms;
84 }
85
86 bool DidCompleteQueryingSuppressedForms() const override;
87
88 void set_did_complete_querying_suppressed_forms(bool value) {
89 did_complete_querying_suppressed_forms_ = value;
72 } 90 }
73 91
74 void SetNonFederated( 92 void SetNonFederated(
75 const std::vector<const autofill::PasswordForm*>& non_federated, 93 const std::vector<const autofill::PasswordForm*>& non_federated,
76 size_t filtered_count); 94 size_t filtered_count);
77 95
78 // Only sets the internal state to WAITING, no call to PasswordStore. 96 // Only sets the internal state to WAITING, no call to PasswordStore.
79 void Fetch() override; 97 void Fetch() override;
80 98
81 // A no-op, returns null. 99 // A no-op, returns null.
82 std::unique_ptr<FormFetcher> Clone() override; 100 std::unique_ptr<FormFetcher> Clone() override;
83 101
84 private: 102 private:
85 std::set<Consumer*> consumers_; 103 std::set<Consumer*> consumers_;
86 State state_ = State::NOT_WAITING; 104 State state_ = State::NOT_WAITING;
87 std::vector<InteractionsStats> stats_; 105 std::vector<InteractionsStats> stats_;
88 std::vector<const autofill::PasswordForm*> federated_; 106 std::vector<const autofill::PasswordForm*> federated_;
89 std::vector<const autofill::PasswordForm*> suppressed_https_forms_; 107 std::vector<const autofill::PasswordForm*> suppressed_https_forms_;
90 bool did_complete_querying_suppressed_https_forms_ = false; 108 std::vector<const autofill::PasswordForm*> suppressed_psl_matching_forms_;
109 std::vector<const autofill::PasswordForm*>
110 suppressed_same_organization_name_forms_;
111 bool did_complete_querying_suppressed_forms_ = false;
91 112
92 DISALLOW_COPY_AND_ASSIGN(FakeFormFetcher); 113 DISALLOW_COPY_AND_ASSIGN(FakeFormFetcher);
93 }; 114 };
94 115
95 } // namespace password_manager 116 } // namespace password_manager
96 117
97 #endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_FAKE_FORM_FETCHER_H_ 118 #endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_FAKE_FORM_FETCHER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698