Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(81)

Side by Side Diff: chrome/browser/password_manager/native_backend_kwallet_x.cc

Issue 459103005: Introduce new PasswordForm attributes for Credential Management API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Mike's comment Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 709 matching lines...) Expand 10 before | Expand all | Expand 10 after
720 pickle->WriteString16(form->password_value); 720 pickle->WriteString16(form->password_value);
721 pickle->WriteString16(form->submit_element); 721 pickle->WriteString16(form->submit_element);
722 pickle->WriteBool(form->ssl_valid); 722 pickle->WriteBool(form->ssl_valid);
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);
731 pickle->WriteString(form->avatar_url.spec());
732 pickle->WriteString(form->federation_url.spec());
733 pickle->WriteBool(form->is_zero_click);
730 } 734 }
731 } 735 }
732 736
733 // static 737 // static
734 bool NativeBackendKWallet::DeserializeValueSize(const std::string& signon_realm, 738 bool NativeBackendKWallet::DeserializeValueSize(const std::string& signon_realm,
735 const PickleIterator& init_iter, 739 const PickleIterator& init_iter,
736 int version, 740 int version,
737 bool size_32, 741 bool size_32,
738 bool warn_only, 742 bool warn_only,
739 PasswordFormList* forms) { 743 PasswordFormList* forms) {
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
810 814
811 if (version > 2) { 815 if (version > 2) {
812 int64 date_synced = 0; 816 int64 date_synced = 0;
813 if (!iter.ReadInt64(&date_synced)) { 817 if (!iter.ReadInt64(&date_synced)) {
814 LogDeserializationWarning(version, signon_realm, false); 818 LogDeserializationWarning(version, signon_realm, false);
815 return false; 819 return false;
816 } 820 }
817 form->date_synced = base::Time::FromInternalValue(date_synced); 821 form->date_synced = base::Time::FromInternalValue(date_synced);
818 } 822 }
819 823
824 if (version > 3) {
825 if (!iter.ReadString16(&form->display_name) ||
826 !ReadGURL(&iter, warn_only, &form->avatar_url) ||
827 !ReadGURL(&iter, warn_only, &form->federation_url) ||
828 !iter.ReadBool(&form->is_zero_click)) {
829 LogDeserializationWarning(version, signon_realm, false);
830 return false;
831 }
832 }
833
820 forms->push_back(form.release()); 834 forms->push_back(form.release());
821 } 835 }
822 836
823 return true; 837 return true;
824 } 838 }
825 839
826 // static 840 // static
827 void NativeBackendKWallet::DeserializeValue(const std::string& signon_realm, 841 void NativeBackendKWallet::DeserializeValue(const std::string& signon_realm,
828 const Pickle& pickle, 842 const Pickle& pickle,
829 PasswordFormList* forms) { 843 PasswordFormList* forms) {
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
938 } 952 }
939 953
940 return handle; 954 return handle;
941 } 955 }
942 956
943 std::string NativeBackendKWallet::GetProfileSpecificFolderName() const { 957 std::string NativeBackendKWallet::GetProfileSpecificFolderName() const {
944 // Originally, the folder name was always just "Chrome Form Data". 958 // Originally, the folder name was always just "Chrome Form Data".
945 // Now we use it to distinguish passwords for different profiles. 959 // Now we use it to distinguish passwords for different profiles.
946 return base::StringPrintf("%s (%d)", kKWalletFolder, profile_id_); 960 return base::StringPrintf("%s (%d)", kKWalletFolder, profile_id_);
947 } 961 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698