| OLD | NEW |
| 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/native_backend_libsecret.h" | 5 #include "chrome/browser/password_manager/native_backend_libsecret.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <libsecret/secret.h> | 10 #include <libsecret/secret.h> |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 changes); | 274 changes); |
| 275 } | 275 } |
| 276 | 276 |
| 277 bool NativeBackendLibsecret::RemoveLoginsSyncedBetween( | 277 bool NativeBackendLibsecret::RemoveLoginsSyncedBetween( |
| 278 base::Time delete_begin, | 278 base::Time delete_begin, |
| 279 base::Time delete_end, | 279 base::Time delete_end, |
| 280 password_manager::PasswordStoreChangeList* changes) { | 280 password_manager::PasswordStoreChangeList* changes) { |
| 281 return RemoveLoginsBetween(delete_begin, delete_end, SYNC_TIMESTAMP, changes); | 281 return RemoveLoginsBetween(delete_begin, delete_end, SYNC_TIMESTAMP, changes); |
| 282 } | 282 } |
| 283 | 283 |
| 284 bool NativeBackendLibsecret::DisableAutoSignInForAllLogins( | 284 bool NativeBackendLibsecret::DisableAutoSignInForOrigins( |
| 285 const base::Callback<bool(const GURL&)>& origin_filter, |
| 285 password_manager::PasswordStoreChangeList* changes) { | 286 password_manager::PasswordStoreChangeList* changes) { |
| 286 ScopedVector<autofill::PasswordForm> all_forms; | 287 ScopedVector<autofill::PasswordForm> all_forms; |
| 287 if (!GetLoginsList(nullptr, ALL_LOGINS, &all_forms)) | 288 if (!GetLoginsList(nullptr, ALL_LOGINS, &all_forms)) |
| 288 return false; | 289 return false; |
| 289 | 290 |
| 290 for (auto& form : all_forms) { | 291 for (auto& form : all_forms) { |
| 291 if (!form->skip_zero_click) { | 292 if (origin_filter.Run(form->origin) && !form->skip_zero_click) { |
| 292 form->skip_zero_click = true; | 293 form->skip_zero_click = true; |
| 293 if (!UpdateLogin(*form, changes)) | 294 if (!UpdateLogin(*form, changes)) |
| 294 return false; | 295 return false; |
| 295 } | 296 } |
| 296 } | 297 } |
| 297 | 298 |
| 298 return true; | 299 return true; |
| 299 } | 300 } |
| 300 | 301 |
| 301 bool NativeBackendLibsecret::GetLogins( | 302 bool NativeBackendLibsecret::GetLogins( |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 558 if (lookup_form) { | 559 if (lookup_form) { |
| 559 UMA_HISTOGRAM_ENUMERATION("PasswordManager.PslDomainMatchTriggering", | 560 UMA_HISTOGRAM_ENUMERATION("PasswordManager.PslDomainMatchTriggering", |
| 560 allow_psl_match | 561 allow_psl_match |
| 561 ? psl_domain_match_metric | 562 ? psl_domain_match_metric |
| 562 : password_manager::PSL_DOMAIN_MATCH_NOT_USED, | 563 : password_manager::PSL_DOMAIN_MATCH_NOT_USED, |
| 563 password_manager::PSL_DOMAIN_MATCH_COUNT); | 564 password_manager::PSL_DOMAIN_MATCH_COUNT); |
| 564 } | 565 } |
| 565 g_list_free(found); | 566 g_list_free(found); |
| 566 return forms; | 567 return forms; |
| 567 } | 568 } |
| OLD | NEW |