| 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/native_backend_gnome_x.h" | 5 #include "chrome/browser/password_manager/native_backend_gnome_x.h" |
| 6 | 6 |
| 7 #include <dlfcn.h> | 7 #include <dlfcn.h> |
| 8 #include <gnome-keyring.h> | 8 #include <gnome-keyring.h> |
| 9 #include <stddef.h> | 9 #include <stddef.h> |
| 10 #include <stdint.h> | 10 #include <stdint.h> |
| (...skipping 688 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 699 return RemoveLoginsBetween(delete_begin, delete_end, SYNC_TIMESTAMP, changes); | 699 return RemoveLoginsBetween(delete_begin, delete_end, SYNC_TIMESTAMP, changes); |
| 700 } | 700 } |
| 701 | 701 |
| 702 bool NativeBackendGnome::DisableAutoSignInForOrigins( | 702 bool NativeBackendGnome::DisableAutoSignInForOrigins( |
| 703 const base::Callback<bool(const GURL&)>& origin_filter, | 703 const base::Callback<bool(const GURL&)>& origin_filter, |
| 704 password_manager::PasswordStoreChangeList* changes) { | 704 password_manager::PasswordStoreChangeList* changes) { |
| 705 ScopedVector<PasswordForm> forms; | 705 ScopedVector<PasswordForm> forms; |
| 706 if (!GetAllLogins(&forms)) | 706 if (!GetAllLogins(&forms)) |
| 707 return false; | 707 return false; |
| 708 | 708 |
| 709 for (auto& form : forms) { | 709 for (auto* form : forms) { |
| 710 if (origin_filter.Run(form->origin) && !form->skip_zero_click) { | 710 if (origin_filter.Run(form->origin) && !form->skip_zero_click) { |
| 711 form->skip_zero_click = true; | 711 form->skip_zero_click = true; |
| 712 if (!UpdateLogin(*form, changes)) | 712 if (!UpdateLogin(*form, changes)) |
| 713 return false; | 713 return false; |
| 714 } | 714 } |
| 715 } | 715 } |
| 716 | 716 |
| 717 return true; | 717 return true; |
| 718 } | 718 } |
| 719 | 719 |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 809 forms->clear(); | 809 forms->clear(); |
| 810 // We could walk the list and add items as we find them, but it is much | 810 // We could walk the list and add items as we find them, but it is much |
| 811 // easier to build the list and then filter the results. | 811 // easier to build the list and then filter the results. |
| 812 ScopedVector<PasswordForm> all_forms; | 812 ScopedVector<PasswordForm> all_forms; |
| 813 if (!GetAllLogins(&all_forms)) | 813 if (!GetAllLogins(&all_forms)) |
| 814 return false; | 814 return false; |
| 815 | 815 |
| 816 base::Time PasswordForm::*date_member = date_to_compare == CREATION_TIMESTAMP | 816 base::Time PasswordForm::*date_member = date_to_compare == CREATION_TIMESTAMP |
| 817 ? &PasswordForm::date_created | 817 ? &PasswordForm::date_created |
| 818 : &PasswordForm::date_synced; | 818 : &PasswordForm::date_synced; |
| 819 for (auto& saved_form : all_forms) { | 819 for (auto*& saved_form : all_forms) { |
| 820 if (get_begin <= saved_form->*date_member && | 820 if (get_begin <= saved_form->*date_member && |
| 821 (get_end.is_null() || saved_form->*date_member < get_end)) { | 821 (get_end.is_null() || saved_form->*date_member < get_end)) { |
| 822 forms->push_back(saved_form); | 822 forms->push_back(saved_form); |
| 823 saved_form = nullptr; | 823 saved_form = nullptr; |
| 824 } | 824 } |
| 825 } | 825 } |
| 826 | 826 |
| 827 return true; | 827 return true; |
| 828 } | 828 } |
| 829 | 829 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 840 ScopedVector<PasswordForm> forms; | 840 ScopedVector<PasswordForm> forms; |
| 841 if (!GetLoginsBetween(get_begin, get_end, date_to_compare, &forms)) | 841 if (!GetLoginsBetween(get_begin, get_end, date_to_compare, &forms)) |
| 842 return false; | 842 return false; |
| 843 | 843 |
| 844 for (size_t i = 0; i < forms.size(); ++i) { | 844 for (size_t i = 0; i < forms.size(); ++i) { |
| 845 if (!RemoveLogin(*forms[i], changes)) | 845 if (!RemoveLogin(*forms[i], changes)) |
| 846 return false; | 846 return false; |
| 847 } | 847 } |
| 848 return true; | 848 return true; |
| 849 } | 849 } |
| OLD | NEW |