| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "chrome/browser/password_manager/password_store_proxy_mac.h" | 5 #include "chrome/browser/password_manager/password_store_proxy_mac.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/metrics/histogram_macros.h" | 10 #include "base/metrics/histogram_macros.h" |
| 11 #include "chrome/browser/password_manager/password_store_mac.h" | 11 #include "chrome/browser/password_manager/password_store_mac.h" |
| 12 #include "chrome/browser/password_manager/simple_password_store_mac.h" | 12 #include "chrome/browser/password_manager/simple_password_store_mac.h" |
| 13 #include "content/public/browser/browser_thread.h" | 13 #include "content/public/browser/browser_thread.h" |
| 14 #include "crypto/apple_keychain.h" | 14 #include "crypto/apple_keychain.h" |
| 15 | 15 |
| 16 using password_manager::MigrationStatus; | 16 using password_manager::MigrationStatus; |
| 17 using password_manager::PasswordStoreChangeList; | 17 using password_manager::PasswordStoreChangeList; |
| 18 | 18 |
| 19 PasswordStoreProxyMac::PasswordStoreProxyMac( | 19 PasswordStoreProxyMac::PasswordStoreProxyMac( |
| 20 scoped_refptr<base::SingleThreadTaskRunner> main_thread_runner, | 20 scoped_refptr<base::SingleThreadTaskRunner> main_thread_runner, |
| 21 scoped_ptr<crypto::AppleKeychain> keychain, | 21 std::unique_ptr<crypto::AppleKeychain> keychain, |
| 22 scoped_ptr<password_manager::LoginDatabase> login_db, | 22 std::unique_ptr<password_manager::LoginDatabase> login_db, |
| 23 PrefService* prefs) | 23 PrefService* prefs) |
| 24 : PasswordStore(main_thread_runner, nullptr), | 24 : PasswordStore(main_thread_runner, nullptr), |
| 25 login_metadata_db_(std::move(login_db)) { | 25 login_metadata_db_(std::move(login_db)) { |
| 26 DCHECK(login_metadata_db_); | 26 DCHECK(login_metadata_db_); |
| 27 migration_status_.Init(password_manager::prefs::kKeychainMigrationStatus, | 27 migration_status_.Init(password_manager::prefs::kKeychainMigrationStatus, |
| 28 prefs); | 28 prefs); |
| 29 if (migration_status_.GetValue() == | 29 if (migration_status_.GetValue() == |
| 30 static_cast<int>(MigrationStatus::MIGRATED)) { | 30 static_cast<int>(MigrationStatus::MIGRATED)) { |
| 31 // The login database will be set later after initialization. | 31 // The login database will be set later after initialization. |
| 32 password_store_simple_ = | 32 password_store_simple_ = |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 | 218 |
| 219 void PasswordStoreProxyMac::AddSiteStatsImpl( | 219 void PasswordStoreProxyMac::AddSiteStatsImpl( |
| 220 const password_manager::InteractionsStats& stats) { | 220 const password_manager::InteractionsStats& stats) { |
| 221 GetBackend()->AddSiteStatsImpl(stats); | 221 GetBackend()->AddSiteStatsImpl(stats); |
| 222 } | 222 } |
| 223 | 223 |
| 224 void PasswordStoreProxyMac::RemoveSiteStatsImpl(const GURL& origin_domain) { | 224 void PasswordStoreProxyMac::RemoveSiteStatsImpl(const GURL& origin_domain) { |
| 225 GetBackend()->RemoveSiteStatsImpl(origin_domain); | 225 GetBackend()->RemoveSiteStatsImpl(origin_domain); |
| 226 } | 226 } |
| 227 | 227 |
| 228 std::vector<scoped_ptr<password_manager::InteractionsStats>> | 228 std::vector<std::unique_ptr<password_manager::InteractionsStats>> |
| 229 PasswordStoreProxyMac::GetSiteStatsImpl(const GURL& origin_domain) { | 229 PasswordStoreProxyMac::GetSiteStatsImpl(const GURL& origin_domain) { |
| 230 return GetBackend()->GetSiteStatsImpl(origin_domain); | 230 return GetBackend()->GetSiteStatsImpl(origin_domain); |
| 231 } | 231 } |
| OLD | NEW |