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_kwallet_x.h" | 5 #include "chrome/browser/password_manager/native_backend_kwallet_x.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
723 pickle->WriteBool(form->preferred); | 723 pickle->WriteBool(form->preferred); |
724 pickle->WriteBool(form->blacklisted_by_user); | 724 pickle->WriteBool(form->blacklisted_by_user); |
725 pickle->WriteInt64(form->date_created.ToTimeT()); | 725 pickle->WriteInt64(form->date_created.ToTimeT()); |
726 pickle->WriteInt(form->type); | 726 pickle->WriteInt(form->type); |
727 pickle->WriteInt(form->times_used); | 727 pickle->WriteInt(form->times_used); |
728 autofill::SerializeFormData(form->form_data, pickle); | 728 autofill::SerializeFormData(form->form_data, pickle); |
729 pickle->WriteInt64(form->date_synced.ToInternalValue()); | 729 pickle->WriteInt64(form->date_synced.ToInternalValue()); |
730 pickle->WriteString16(form->display_name); | 730 pickle->WriteString16(form->display_name); |
731 pickle->WriteString(form->avatar_url.spec()); | 731 pickle->WriteString(form->avatar_url.spec()); |
732 pickle->WriteString(form->federation_url.spec()); | 732 pickle->WriteString(form->federation_url.spec()); |
733 pickle->WriteBool(form->is_zero_click); | 733 pickle->WriteBool(form->skip_zero_click); |
734 } | 734 } |
735 } | 735 } |
736 | 736 |
737 // static | 737 // static |
738 bool NativeBackendKWallet::DeserializeValueSize( | 738 bool NativeBackendKWallet::DeserializeValueSize( |
739 const std::string& signon_realm, | 739 const std::string& signon_realm, |
740 const PickleIterator& init_iter, | 740 const PickleIterator& init_iter, |
741 int version, | 741 int version, |
742 bool size_32, | 742 bool size_32, |
743 bool warn_only, | 743 bool warn_only, |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
819 LogDeserializationWarning(version, signon_realm, false); | 819 LogDeserializationWarning(version, signon_realm, false); |
820 return false; | 820 return false; |
821 } | 821 } |
822 form->date_synced = base::Time::FromInternalValue(date_synced); | 822 form->date_synced = base::Time::FromInternalValue(date_synced); |
823 } | 823 } |
824 | 824 |
825 if (version > 3) { | 825 if (version > 3) { |
826 if (!iter.ReadString16(&form->display_name) || | 826 if (!iter.ReadString16(&form->display_name) || |
827 !ReadGURL(&iter, warn_only, &form->avatar_url) || | 827 !ReadGURL(&iter, warn_only, &form->avatar_url) || |
828 !ReadGURL(&iter, warn_only, &form->federation_url) || | 828 !ReadGURL(&iter, warn_only, &form->federation_url) || |
829 !iter.ReadBool(&form->is_zero_click)) { | 829 !iter.ReadBool(&form->skip_zero_click)) { |
830 LogDeserializationWarning(version, signon_realm, false); | 830 LogDeserializationWarning(version, signon_realm, false); |
831 return false; | 831 return false; |
832 } | 832 } |
833 } | 833 } |
834 | 834 |
835 forms->push_back(form.release()); | 835 forms->push_back(form.release()); |
836 } | 836 } |
837 | 837 |
838 return true; | 838 return true; |
839 } | 839 } |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
954 } | 954 } |
955 | 955 |
956 return handle; | 956 return handle; |
957 } | 957 } |
958 | 958 |
959 std::string NativeBackendKWallet::GetProfileSpecificFolderName() const { | 959 std::string NativeBackendKWallet::GetProfileSpecificFolderName() const { |
960 // Originally, the folder name was always just "Chrome Form Data". | 960 // Originally, the folder name was always just "Chrome Form Data". |
961 // Now we use it to distinguish passwords for different profiles. | 961 // Now we use it to distinguish passwords for different profiles. |
962 return base::StringPrintf("%s (%d)", kKWalletFolder, profile_id_); | 962 return base::StringPrintf("%s (%d)", kKWalletFolder, profile_id_); |
963 } | 963 } |
OLD | NEW |