OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_mac.h" | 5 #include "chrome/browser/password_manager/password_store_mac.h" |
6 | 6 |
7 #include <CoreServices/CoreServices.h> | 7 #include <CoreServices/CoreServices.h> |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <set> | 10 #include <set> |
(...skipping 1327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1338 if (login_metadata_db_) | 1338 if (login_metadata_db_) |
1339 login_metadata_db_->stats_table().AddRow(stats); | 1339 login_metadata_db_->stats_table().AddRow(stats); |
1340 } | 1340 } |
1341 | 1341 |
1342 void PasswordStoreMac::RemoveSiteStatsImpl(const GURL& origin_domain) { | 1342 void PasswordStoreMac::RemoveSiteStatsImpl(const GURL& origin_domain) { |
1343 DCHECK(GetBackgroundTaskRunner()->BelongsToCurrentThread()); | 1343 DCHECK(GetBackgroundTaskRunner()->BelongsToCurrentThread()); |
1344 if (login_metadata_db_) | 1344 if (login_metadata_db_) |
1345 login_metadata_db_->stats_table().RemoveRow(origin_domain); | 1345 login_metadata_db_->stats_table().RemoveRow(origin_domain); |
1346 } | 1346 } |
1347 | 1347 |
1348 std::vector<std::unique_ptr<password_manager::InteractionsStats>> | 1348 std::vector<password_manager::InteractionsStats> |
1349 PasswordStoreMac::GetSiteStatsImpl(const GURL& origin_domain) { | 1349 PasswordStoreMac::GetSiteStatsImpl(const GURL& origin_domain) { |
1350 DCHECK(GetBackgroundTaskRunner()->BelongsToCurrentThread()); | 1350 DCHECK(GetBackgroundTaskRunner()->BelongsToCurrentThread()); |
1351 return login_metadata_db_ | 1351 return login_metadata_db_ |
1352 ? login_metadata_db_->stats_table().GetRows(origin_domain) | 1352 ? login_metadata_db_->stats_table().GetRows(origin_domain) |
1353 : std::vector< | 1353 : std::vector<password_manager::InteractionsStats>(); |
1354 std::unique_ptr<password_manager::InteractionsStats>>(); | |
1355 } | 1354 } |
1356 | 1355 |
1357 bool PasswordStoreMac::AddToKeychainIfNecessary(const PasswordForm& form) { | 1356 bool PasswordStoreMac::AddToKeychainIfNecessary(const PasswordForm& form) { |
1358 if (IsLoginDatabaseOnlyForm(form)) | 1357 if (IsLoginDatabaseOnlyForm(form)) |
1359 return true; | 1358 return true; |
1360 MacKeychainPasswordFormAdapter keychainAdapter(keychain_.get()); | 1359 MacKeychainPasswordFormAdapter keychainAdapter(keychain_.get()); |
1361 return keychainAdapter.AddPassword(form); | 1360 return keychainAdapter.AddPassword(form); |
1362 } | 1361 } |
1363 | 1362 |
1364 bool PasswordStoreMac::DatabaseHasFormMatchingKeychainForm( | 1363 bool PasswordStoreMac::DatabaseHasFormMatchingKeychainForm( |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1420 ScopedVector<PasswordForm> forms_with_keychain_entry; | 1419 ScopedVector<PasswordForm> forms_with_keychain_entry; |
1421 internal_keychain_helpers::GetPasswordsForForms(*keychain_, &database_forms, | 1420 internal_keychain_helpers::GetPasswordsForForms(*keychain_, &database_forms, |
1422 &forms_with_keychain_entry); | 1421 &forms_with_keychain_entry); |
1423 | 1422 |
1424 // Clean up any orphaned database entries. | 1423 // Clean up any orphaned database entries. |
1425 RemoveDatabaseForms(&database_forms); | 1424 RemoveDatabaseForms(&database_forms); |
1426 | 1425 |
1427 // Move the orphaned DB forms to the output parameter. | 1426 // Move the orphaned DB forms to the output parameter. |
1428 AppendSecondToFirst(orphaned_forms, &database_forms); | 1427 AppendSecondToFirst(orphaned_forms, &database_forms); |
1429 } | 1428 } |
OLD | NEW |