| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 #include "ui/base/l10n/l10n_util.h" | 30 #include "ui/base/l10n/l10n_util.h" |
| 31 #include "url/origin.h" | 31 #include "url/origin.h" |
| 32 | 32 |
| 33 using autofill::PasswordForm; | 33 using autofill::PasswordForm; |
| 34 using content::BrowserThread; | 34 using content::BrowserThread; |
| 35 | 35 |
| 36 namespace { | 36 namespace { |
| 37 | 37 |
| 38 // In case the fields in the pickle ever change, version them so we can try to | 38 // In case the fields in the pickle ever change, version them so we can try to |
| 39 // read old pickles. (Note: do not eat old pickles past the expiration date.) | 39 // read old pickles. (Note: do not eat old pickles past the expiration date.) |
| 40 const int kPickleVersion = 7; | 40 const int kPickleVersion = 8; |
| 41 | 41 |
| 42 // We could localize this string, but then changing your locale would cause | 42 // We could localize this string, but then changing your locale would cause |
| 43 // you to lose access to all your stored passwords. Maybe best not to do that. | 43 // you to lose access to all your stored passwords. Maybe best not to do that. |
| 44 // Name of the folder to store passwords in. | 44 // Name of the folder to store passwords in. |
| 45 const char kKWalletFolder[] = "Chrome Form Data"; | 45 const char kKWalletFolder[] = "Chrome Form Data"; |
| 46 | 46 |
| 47 // DBus service, path, and interface names for klauncher and kwalletd. | 47 // DBus service, path, and interface names for klauncher and kwalletd. |
| 48 const char kKWalletDName[] = "kwalletd"; | 48 const char kKWalletDName[] = "kwalletd"; |
| 49 const char kKWalletD5Name[] = "kwalletd5"; | 49 const char kKWalletD5Name[] = "kwalletd5"; |
| 50 const char kKWalletServiceName[] = "org.kde.kwalletd"; | 50 const char kKWalletServiceName[] = "org.kde.kwalletd"; |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 } | 214 } |
| 215 | 215 |
| 216 if (version > 3) { | 216 if (version > 3) { |
| 217 if (!iter.ReadString16(&form->display_name) || | 217 if (!iter.ReadString16(&form->display_name) || |
| 218 !ReadGURL(&iter, warn_only, &form->icon_url) || | 218 !ReadGURL(&iter, warn_only, &form->icon_url) || |
| 219 !ReadOrigin(&iter, warn_only, &form->federation_origin) || | 219 !ReadOrigin(&iter, warn_only, &form->federation_origin) || |
| 220 !iter.ReadBool(&form->skip_zero_click)) { | 220 !iter.ReadBool(&form->skip_zero_click)) { |
| 221 LogDeserializationWarning(version, signon_realm, false); | 221 LogDeserializationWarning(version, signon_realm, false); |
| 222 return false; | 222 return false; |
| 223 } | 223 } |
| 224 if (version <= 7) |
| 225 form->skip_zero_click = true; |
| 224 } | 226 } |
| 225 | 227 |
| 226 if (version > 4) { | 228 if (version > 4) { |
| 227 form->date_created = base::Time::FromInternalValue(date_created); | 229 form->date_created = base::Time::FromInternalValue(date_created); |
| 228 } else { | 230 } else { |
| 229 form->date_created = base::Time::FromTimeT(date_created); | 231 form->date_created = base::Time::FromTimeT(date_created); |
| 230 } | 232 } |
| 231 | 233 |
| 232 if (version > 5) { | 234 if (version > 5) { |
| 233 bool read_success = iter.ReadInt(&generation_upload_status); | 235 bool read_success = iter.ReadInt(&generation_upload_status); |
| (...skipping 837 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1071 } | 1073 } |
| 1072 | 1074 |
| 1073 return handle; | 1075 return handle; |
| 1074 } | 1076 } |
| 1075 | 1077 |
| 1076 std::string NativeBackendKWallet::GetProfileSpecificFolderName() const { | 1078 std::string NativeBackendKWallet::GetProfileSpecificFolderName() const { |
| 1077 // Originally, the folder name was always just "Chrome Form Data". | 1079 // Originally, the folder name was always just "Chrome Form Data". |
| 1078 // Now we use it to distinguish passwords for different profiles. | 1080 // Now we use it to distinguish passwords for different profiles. |
| 1079 return base::StringPrintf("%s (%d)", kKWalletFolder, profile_id_); | 1081 return base::StringPrintf("%s (%d)", kKWalletFolder, profile_id_); |
| 1080 } | 1082 } |
| OLD | NEW |