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 #include "components/password_manager/core/browser/fake_form_fetcher.h" | 5 #include "components/password_manager/core/browser/fake_form_fetcher.h" |
6 | 6 |
7 #include "components/autofill/core/common/password_form.h" | 7 #include "components/autofill/core/common/password_form.h" |
8 #include "components/password_manager/core/browser/statistics_table.h" | 8 #include "components/password_manager/core/browser/statistics_table.h" |
9 | 9 |
10 using autofill::PasswordForm; | 10 using autofill::PasswordForm; |
11 | 11 |
12 namespace password_manager { | 12 namespace password_manager { |
13 | 13 |
14 FakeFormFetcher::FakeFormFetcher() = default; | 14 FakeFormFetcher::FakeFormFetcher() = default; |
15 | 15 |
16 FakeFormFetcher::~FakeFormFetcher() = default; | 16 FakeFormFetcher::~FakeFormFetcher() = default; |
17 | 17 |
18 void FakeFormFetcher::AddConsumer(Consumer* consumer) { | 18 void FakeFormFetcher::AddConsumer(Consumer* consumer) { |
19 consumers_.insert(consumer); | 19 consumers_.insert(consumer); |
20 } | 20 } |
21 | 21 |
| 22 void FakeFormFetcher::RemoveConsumer(Consumer* consumer) { |
| 23 consumers_.erase(consumer); |
| 24 } |
| 25 |
22 FormFetcher::State FakeFormFetcher::GetState() const { | 26 FormFetcher::State FakeFormFetcher::GetState() const { |
23 return state_; | 27 return state_; |
24 } | 28 } |
25 | 29 |
26 const std::vector<InteractionsStats>& FakeFormFetcher::GetInteractionsStats() | 30 const std::vector<InteractionsStats>& FakeFormFetcher::GetInteractionsStats() |
27 const { | 31 const { |
28 return stats_; | 32 return stats_; |
29 } | 33 } |
30 | 34 |
31 const std::vector<const autofill::PasswordForm*>& | 35 const std::vector<const autofill::PasswordForm*>& |
(...skipping 12 matching lines...) Expand all Loading... |
44 | 48 |
45 void FakeFormFetcher::Fetch() { | 49 void FakeFormFetcher::Fetch() { |
46 state_ = State::WAITING; | 50 state_ = State::WAITING; |
47 } | 51 } |
48 | 52 |
49 std::unique_ptr<FormFetcher> FakeFormFetcher::Clone() { | 53 std::unique_ptr<FormFetcher> FakeFormFetcher::Clone() { |
50 return nullptr; | 54 return nullptr; |
51 } | 55 } |
52 | 56 |
53 } // namespace password_manager | 57 } // namespace password_manager |
OLD | NEW |