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

Unified Diff: components/password_manager/sync/browser/sync_store_result_filter.h

Issue 1260263002: Move ShouldFilterAutofillResult from ChromePasswordManagerClient to PasswordManager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Just rebased Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: components/password_manager/sync/browser/sync_store_result_filter.h
diff --git a/components/password_manager/sync/browser/sync_store_result_filter.h b/components/password_manager/sync/browser/sync_store_result_filter.h
new file mode 100644
index 0000000000000000000000000000000000000000..8d737f1c765ca515dade584e23c6df1677ba6bd8
--- /dev/null
+++ b/components/password_manager/sync/browser/sync_store_result_filter.h
@@ -0,0 +1,46 @@
+// Copyright 2015 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.
+
+#ifndef COMPONENTS_PASSWORD_MANAGER_SYNC_BROWSER_STORE_RESULT_FILTER_H_
+#define COMPONENTS_PASSWORD_MANAGER_SYNC_BROWSER_STORE_RESULT_FILTER_H_
+
+#include "components/password_manager/core/browser/store_result_filter.h"
+
+namespace password_manager {
+
+class PasswordManagerClient;
+
+// The sync- and GAIA- aware implementation of the filter.
+class SyncStoreResultFilter : public StoreResultFilter {
+ public:
+ explicit SyncStoreResultFilter(const PasswordManagerClient* client);
+ ~SyncStoreResultFilter() override;
+
+ // StoreResultFilter
+ bool ShouldIgnore(const autofill::PasswordForm& form) override;
+
+ private:
+ enum AutofillForSyncCredentialsState {
+ ALLOW_SYNC_CREDENTIALS,
+ DISALLOW_SYNC_CREDENTIALS_FOR_REAUTH,
+ DISALLOW_SYNC_CREDENTIALS,
+ };
+
+ // Determines autofill state based on experiment and flag values.
+ static AutofillForSyncCredentialsState SetUpAutofillSyncState();
+
+ const PasswordManagerClient* const client_;
+
+ // How to handle the sync credential in ShouldFilterAutofillResult().
+ const AutofillForSyncCredentialsState autofill_sync_state_;
+
+ // For statistics about filtering the sync credential during autofill.
+ bool sync_credential_was_filtered_;
+
+ DISALLOW_COPY_AND_ASSIGN(SyncStoreResultFilter);
+};
+
+} // namespace password_manager
+
+#endif // COMPONENTS_PASSWORD_MANAGER_SYNC_BROWSER_STORE_RESULT_FILTER_H_
« no previous file with comments | « components/password_manager/sync/browser/DEPS ('k') | components/password_manager/sync/browser/sync_store_result_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698