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

Unified Diff: components/password_manager/core/browser/http_password_migrator.h

Issue 2667363003: Enable moving of credentials in HttpPasswordMigrator (Closed)
Patch Set: Comments. Created 3 years, 11 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/core/browser/http_password_migrator.h
diff --git a/components/password_manager/core/browser/http_password_migrator.h b/components/password_manager/core/browser/http_password_migrator.h
index cf054487eef2cd0560f35b73dca65944e727fd5c..7d9d0963df16164e7b6956c76683221c171329d9 100644
--- a/components/password_manager/core/browser/http_password_migrator.h
+++ b/components/password_manager/core/browser/http_password_migrator.h
@@ -25,6 +25,11 @@ class PasswordStore;
// origin.
class HttpPasswordMigrator : public PasswordStoreConsumer {
public:
+ enum class MigrationMode {
+ MOVE, // HTTP credentials are deleted after migration to HTTPS.
+ COPY, // HTTP credentials are kept after migration to HTTPS.
+ };
+
// API to be implemented by an embedder of HttpPasswordMigrator.
class Consumer {
public:
@@ -38,6 +43,7 @@ class HttpPasswordMigrator : public PasswordStoreConsumer {
// |https_origin| should specify a valid HTTPS URL.
HttpPasswordMigrator(const GURL& https_origin,
+ MigrationMode mode,
PasswordStore* password_store,
Consumer* consumer);
~HttpPasswordMigrator() override;
@@ -47,6 +53,7 @@ class HttpPasswordMigrator : public PasswordStoreConsumer {
std::vector<std::unique_ptr<autofill::PasswordForm>> results) override;
private:
+ const MigrationMode mode_;
Consumer* consumer_;
PasswordStore* password_store_;

Powered by Google App Engine
This is Rietveld 408576698