| 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 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 int64 date_synced = 0; | 196 int64 date_synced = 0; |
| 197 if (!iter.ReadInt64(&date_synced)) { | 197 if (!iter.ReadInt64(&date_synced)) { |
| 198 LogDeserializationWarning(version, signon_realm, false); | 198 LogDeserializationWarning(version, signon_realm, false); |
| 199 return false; | 199 return false; |
| 200 } | 200 } |
| 201 form->date_synced = base::Time::FromInternalValue(date_synced); | 201 form->date_synced = base::Time::FromInternalValue(date_synced); |
| 202 } | 202 } |
| 203 | 203 |
| 204 if (version > 3) { | 204 if (version > 3) { |
| 205 if (!iter.ReadString16(&form->display_name) || | 205 if (!iter.ReadString16(&form->display_name) || |
| 206 !ReadGURL(&iter, warn_only, &form->avatar_url) || | 206 !ReadGURL(&iter, warn_only, &form->icon_url) || |
| 207 !ReadGURL(&iter, warn_only, &form->federation_url) || | 207 !ReadGURL(&iter, warn_only, &form->federation_url) || |
| 208 !iter.ReadBool(&form->skip_zero_click)) { | 208 !iter.ReadBool(&form->skip_zero_click)) { |
| 209 LogDeserializationWarning(version, signon_realm, false); | 209 LogDeserializationWarning(version, signon_realm, false); |
| 210 return false; | 210 return false; |
| 211 } | 211 } |
| 212 } | 212 } |
| 213 | 213 |
| 214 if (version > 4) { | 214 if (version > 4) { |
| 215 form->date_created = base::Time::FromInternalValue(date_created); | 215 form->date_created = base::Time::FromInternalValue(date_created); |
| 216 } else { | 216 } else { |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 pickle->WriteString16(form->submit_element); | 255 pickle->WriteString16(form->submit_element); |
| 256 pickle->WriteBool(form->ssl_valid); | 256 pickle->WriteBool(form->ssl_valid); |
| 257 pickle->WriteBool(form->preferred); | 257 pickle->WriteBool(form->preferred); |
| 258 pickle->WriteBool(form->blacklisted_by_user); | 258 pickle->WriteBool(form->blacklisted_by_user); |
| 259 pickle->WriteInt64(form->date_created.ToInternalValue()); | 259 pickle->WriteInt64(form->date_created.ToInternalValue()); |
| 260 pickle->WriteInt(form->type); | 260 pickle->WriteInt(form->type); |
| 261 pickle->WriteInt(form->times_used); | 261 pickle->WriteInt(form->times_used); |
| 262 autofill::SerializeFormData(form->form_data, pickle); | 262 autofill::SerializeFormData(form->form_data, pickle); |
| 263 pickle->WriteInt64(form->date_synced.ToInternalValue()); | 263 pickle->WriteInt64(form->date_synced.ToInternalValue()); |
| 264 pickle->WriteString16(form->display_name); | 264 pickle->WriteString16(form->display_name); |
| 265 pickle->WriteString(form->avatar_url.spec()); | 265 pickle->WriteString(form->icon_url.spec()); |
| 266 pickle->WriteString(form->federation_url.spec()); | 266 pickle->WriteString(form->federation_url.spec()); |
| 267 pickle->WriteBool(form->skip_zero_click); | 267 pickle->WriteBool(form->skip_zero_click); |
| 268 pickle->WriteInt(form->generation_upload_status); | 268 pickle->WriteInt(form->generation_upload_status); |
| 269 } | 269 } |
| 270 } | 270 } |
| 271 | 271 |
| 272 // Moves the content of |second| to the end of |first|. | 272 // Moves the content of |second| to the end of |first|. |
| 273 void AppendSecondToFirst(ScopedVector<autofill::PasswordForm>* first, | 273 void AppendSecondToFirst(ScopedVector<autofill::PasswordForm>* first, |
| 274 ScopedVector<autofill::PasswordForm> second) { | 274 ScopedVector<autofill::PasswordForm> second) { |
| 275 first->reserve(first->size() + second.size()); | 275 first->reserve(first->size() + second.size()); |
| (...skipping 736 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1012 } | 1012 } |
| 1013 | 1013 |
| 1014 return handle; | 1014 return handle; |
| 1015 } | 1015 } |
| 1016 | 1016 |
| 1017 std::string NativeBackendKWallet::GetProfileSpecificFolderName() const { | 1017 std::string NativeBackendKWallet::GetProfileSpecificFolderName() const { |
| 1018 // Originally, the folder name was always just "Chrome Form Data". | 1018 // Originally, the folder name was always just "Chrome Form Data". |
| 1019 // Now we use it to distinguish passwords for different profiles. | 1019 // Now we use it to distinguish passwords for different profiles. |
| 1020 return base::StringPrintf("%s (%d)", kKWalletFolder, profile_id_); | 1020 return base::StringPrintf("%s (%d)", kKWalletFolder, profile_id_); |
| 1021 } | 1021 } |
| OLD | NEW |