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 <iterator> | 10 #include <iterator> |
(...skipping 1283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1294 login_metadata_db_->stats_table().AddRow(stats); | 1294 login_metadata_db_->stats_table().AddRow(stats); |
1295 } | 1295 } |
1296 | 1296 |
1297 void PasswordStoreMac::RemoveSiteStatsImpl(const GURL& origin_domain) { | 1297 void PasswordStoreMac::RemoveSiteStatsImpl(const GURL& origin_domain) { |
1298 DCHECK(GetBackgroundTaskRunner()->BelongsToCurrentThread()); | 1298 DCHECK(GetBackgroundTaskRunner()->BelongsToCurrentThread()); |
1299 if (login_metadata_db_) | 1299 if (login_metadata_db_) |
1300 login_metadata_db_->stats_table().RemoveRow(origin_domain); | 1300 login_metadata_db_->stats_table().RemoveRow(origin_domain); |
1301 } | 1301 } |
1302 | 1302 |
1303 std::vector<password_manager::InteractionsStats> | 1303 std::vector<password_manager::InteractionsStats> |
| 1304 PasswordStoreMac::GetAllSiteStatsImpl() { |
| 1305 DCHECK(GetBackgroundTaskRunner()->BelongsToCurrentThread()); |
| 1306 return login_metadata_db_ |
| 1307 ? login_metadata_db_->stats_table().GetAllRows() |
| 1308 : std::vector<password_manager::InteractionsStats>(); |
| 1309 } |
| 1310 |
| 1311 std::vector<password_manager::InteractionsStats> |
1304 PasswordStoreMac::GetSiteStatsImpl(const GURL& origin_domain) { | 1312 PasswordStoreMac::GetSiteStatsImpl(const GURL& origin_domain) { |
1305 DCHECK(GetBackgroundTaskRunner()->BelongsToCurrentThread()); | 1313 DCHECK(GetBackgroundTaskRunner()->BelongsToCurrentThread()); |
1306 return login_metadata_db_ | 1314 return login_metadata_db_ |
1307 ? login_metadata_db_->stats_table().GetRows(origin_domain) | 1315 ? login_metadata_db_->stats_table().GetRows(origin_domain) |
1308 : std::vector<password_manager::InteractionsStats>(); | 1316 : std::vector<password_manager::InteractionsStats>(); |
1309 } | 1317 } |
1310 | 1318 |
1311 bool PasswordStoreMac::AddToKeychainIfNecessary(const PasswordForm& form) { | 1319 bool PasswordStoreMac::AddToKeychainIfNecessary(const PasswordForm& form) { |
1312 if (IsLoginDatabaseOnlyForm(form)) | 1320 if (IsLoginDatabaseOnlyForm(form)) |
1313 return true; | 1321 return true; |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1370 std::vector<std::unique_ptr<PasswordForm>> forms_with_keychain_entry; | 1378 std::vector<std::unique_ptr<PasswordForm>> forms_with_keychain_entry; |
1371 internal_keychain_helpers::GetPasswordsForForms(*keychain_, &database_forms, | 1379 internal_keychain_helpers::GetPasswordsForForms(*keychain_, &database_forms, |
1372 &forms_with_keychain_entry); | 1380 &forms_with_keychain_entry); |
1373 | 1381 |
1374 // Clean up any orphaned database entries. | 1382 // Clean up any orphaned database entries. |
1375 RemoveDatabaseForms(&database_forms); | 1383 RemoveDatabaseForms(&database_forms); |
1376 | 1384 |
1377 // Move the orphaned DB forms to the output parameter. | 1385 // Move the orphaned DB forms to the output parameter. |
1378 AppendSecondToFirst(orphaned_forms, &database_forms); | 1386 AppendSecondToFirst(orphaned_forms, &database_forms); |
1379 } | 1387 } |
OLD | NEW |