Chromium Code Reviews| 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 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 237 LogDeserializationWarning(version, signon_realm, false); | 237 LogDeserializationWarning(version, signon_realm, false); |
| 238 return false; | 238 return false; |
| 239 } | 239 } |
| 240 if (read_success) { | 240 if (read_success) { |
| 241 form->generation_upload_status = | 241 form->generation_upload_status = |
| 242 static_cast<PasswordForm::GenerationUploadStatus>( | 242 static_cast<PasswordForm::GenerationUploadStatus>( |
| 243 generation_upload_status); | 243 generation_upload_status); |
| 244 } | 244 } |
| 245 } | 245 } |
| 246 | 246 |
| 247 if (version > 7) { | |
| 248 form->skip_zero_click = true; | |
|
vasilii
2016/02/26 11:46:30
It's a bug. You read "true" always even if you sav
Mike West
2016/02/26 12:29:34
Yeah, I misunderstood what was going on here. Adde
| |
| 249 } | |
| 250 | |
| 247 converted_forms.push_back(std::move(form)); | 251 converted_forms.push_back(std::move(form)); |
| 248 } | 252 } |
| 249 | 253 |
| 250 forms->swap(converted_forms); | 254 forms->swap(converted_forms); |
| 251 return true; | 255 return true; |
| 252 } | 256 } |
| 253 | 257 |
| 254 // Serializes a list of PasswordForms to be stored in the wallet. | 258 // Serializes a list of PasswordForms to be stored in the wallet. |
| 255 void SerializeValue(const std::vector<autofill::PasswordForm*>& forms, | 259 void SerializeValue(const std::vector<autofill::PasswordForm*>& forms, |
| 256 base::Pickle* pickle) { | 260 base::Pickle* pickle) { |
| (...skipping 814 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1071 } | 1075 } |
| 1072 | 1076 |
| 1073 return handle; | 1077 return handle; |
| 1074 } | 1078 } |
| 1075 | 1079 |
| 1076 std::string NativeBackendKWallet::GetProfileSpecificFolderName() const { | 1080 std::string NativeBackendKWallet::GetProfileSpecificFolderName() const { |
| 1077 // Originally, the folder name was always just "Chrome Form Data". | 1081 // Originally, the folder name was always just "Chrome Form Data". |
| 1078 // Now we use it to distinguish passwords for different profiles. | 1082 // Now we use it to distinguish passwords for different profiles. |
| 1079 return base::StringPrintf("%s (%d)", kKWalletFolder, profile_id_); | 1083 return base::StringPrintf("%s (%d)", kKWalletFolder, profile_id_); |
| 1080 } | 1084 } |
| OLD | NEW |