Index: chrome/browser/password_manager/password_store_proxy_mac.h |
diff --git a/chrome/browser/password_manager/password_store_proxy_mac.h b/chrome/browser/password_manager/password_store_proxy_mac.h |
index 67029cf3ceec3be5219ef9f0993db80496d74d6f..b9da23f6086b23c0e02fbb8885b87fb89289af44 100644 |
--- a/chrome/browser/password_manager/password_store_proxy_mac.h |
+++ b/chrome/browser/password_manager/password_store_proxy_mac.h |
@@ -5,6 +5,8 @@ |
#ifndef CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_PROXY_MAC_H_ |
#define CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_PROXY_MAC_H_ |
+#include "base/prefs/pref_member.h" |
+#include "base/synchronization/waitable_event.h" |
#include "base/threading/thread.h" |
#include "components/password_manager/core/browser/password_store.h" |
@@ -25,10 +27,27 @@ class SimplePasswordStoreMac; |
// user's state. |
class PasswordStoreProxyMac : public password_manager::PasswordStore { |
public: |
+ enum MigrationStatus { |
+ // Migration wasn't tried yet. |
+ NOT_STARTED = 0, |
+ |
+ // Migration finished successfully. |
+ MIGRATED, |
+ |
+ // Migration failed once. It should be tried again. |
+ FAILED_ONCE, |
+ |
+ // Migration failed twice. It should not be tried again. |
+ FAILED_TWICE, |
+ |
+ NUM_MIGRATION_STATUS, |
+ }; |
+ |
PasswordStoreProxyMac( |
scoped_refptr<base::SingleThreadTaskRunner> main_thread_runner, |
scoped_ptr<crypto::AppleKeychain> keychain, |
- scoped_ptr<password_manager::LoginDatabase> login_db); |
+ scoped_ptr<password_manager::LoginDatabase> login_db, |
+ PrefService* prefs); |
bool Init(const syncer::SyncableService::StartSyncFlare& flare) override; |
void Shutdown() override; |
@@ -47,7 +66,13 @@ class PasswordStoreProxyMac : public password_manager::PasswordStore { |
password_manager::PasswordStore* GetBackend() const; |
// Opens LoginDatabase on the background |thread_|. |
- void InitOnBackgroundThread(); |
+ void InitOnBackgroundThread(MigrationStatus status); |
+ |
+ // Writes status to the prefs. |
+ void UpdateStatusPref(MigrationStatus status); |
+ |
+ // Reports |status| via UMA. |
+ static void ReportStatusPref(MigrationStatus status); |
// PasswordStore: |
void ReportMetricsImpl(const std::string& sync_username, |
@@ -87,6 +112,12 @@ class PasswordStoreProxyMac : public password_manager::PasswordStore { |
// Thread that the synchronous methods are run on. |
scoped_ptr<base::Thread> thread_; |
+ // Current migration status for the profile. |
+ IntegerPrefMember migration_status_; |
+ |
+ // Signals the main thread that the migration is finished or won't be done. |
+ base::WaitableEvent migration_completion_; |
+ |
DISALLOW_COPY_AND_ASSIGN(PasswordStoreProxyMac); |
}; |