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

Unified Diff: components/password_manager/core/browser/fake_form_fetcher.cc

Issue 2263933002: Make FormFetcher a PasswordStoreConsumer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@621355_form_fetcher
Patch Set: Also operator= is now default Created 4 years 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 side-by-side diff with in-line comments
Download patch
Index: components/password_manager/core/browser/fake_form_fetcher.cc
diff --git a/components/password_manager/core/browser/fake_form_fetcher.cc b/components/password_manager/core/browser/fake_form_fetcher.cc
new file mode 100644
index 0000000000000000000000000000000000000000..a25c93bdf15d4edc905727238075a13a2068749f
--- /dev/null
+++ b/components/password_manager/core/browser/fake_form_fetcher.cc
@@ -0,0 +1,49 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "components/password_manager/core/browser/fake_form_fetcher.h"
+
+#include "components/autofill/core/common/password_form.h"
+#include "components/password_manager/core/browser/statistics_table.h"
+
+using autofill::PasswordForm;
+
+namespace password_manager {
+
+FakeFormFetcher::FakeFormFetcher() = default;
+
+FakeFormFetcher::~FakeFormFetcher() = default;
+
+void FakeFormFetcher::AddConsumer(Consumer* consumer) {
+ consumers_.insert(consumer);
+}
+
+FormFetcher::State FakeFormFetcher::GetState() const {
+ return state_;
+}
+
+const std::vector<const InteractionsStats*>&
+FakeFormFetcher::GetInteractionsStats() const {
+ return stats_;
+}
+
+const std::vector<const autofill::PasswordForm*>&
+FakeFormFetcher::GetFederatedMatches() const {
+ return federated_;
+}
+
+void FakeFormFetcher::SetNonFederated(
+ const std::vector<const autofill::PasswordForm*>& non_federated,
+ size_t filtered_count) {
+ state_ = State::NOT_WAITING;
+ for (Consumer* consumer : consumers_) {
+ consumer->ProcessMatches(non_federated, filtered_count);
+ }
+}
+
+void FakeFormFetcher::Fetch() {
+ state_ = State::WAITING;
+}
+
+} // namespace password_manager
« no previous file with comments | « components/password_manager/core/browser/fake_form_fetcher.h ('k') | components/password_manager/core/browser/form_fetcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698