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/password_store_x.h" | 5 #include "chrome/browser/password_manager/password_store_x.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <map> | 8 #include <map> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 } else if (allow_default_store()) { | 58 } else if (allow_default_store()) { |
59 changes = PasswordStoreDefault::AddLoginImpl(form); | 59 changes = PasswordStoreDefault::AddLoginImpl(form); |
60 } | 60 } |
61 return changes; | 61 return changes; |
62 } | 62 } |
63 | 63 |
64 PasswordStoreChangeList PasswordStoreX::UpdateLoginImpl( | 64 PasswordStoreChangeList PasswordStoreX::UpdateLoginImpl( |
65 const PasswordForm& form) { | 65 const PasswordForm& form) { |
66 CheckMigration(); | 66 CheckMigration(); |
67 PasswordStoreChangeList changes; | 67 PasswordStoreChangeList changes; |
68 if (use_native_backend() && backend_->UpdateLogin(form)) { | 68 if (use_native_backend() && backend_->UpdateLogin(form, &changes)) { |
69 changes.push_back(PasswordStoreChange(PasswordStoreChange::UPDATE, form)); | |
70 allow_fallback_ = false; | 69 allow_fallback_ = false; |
71 } else if (allow_default_store()) { | 70 } else if (allow_default_store()) { |
72 changes = PasswordStoreDefault::UpdateLoginImpl(form); | 71 changes = PasswordStoreDefault::UpdateLoginImpl(form); |
73 } | 72 } |
74 return changes; | 73 return changes; |
75 } | 74 } |
76 | 75 |
77 PasswordStoreChangeList PasswordStoreX::RemoveLoginImpl( | 76 PasswordStoreChangeList PasswordStoreX::RemoveLoginImpl( |
78 const PasswordForm& form) { | 77 const PasswordForm& form) { |
79 CheckMigration(); | 78 CheckMigration(); |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 // it before deleting the file just in case there is some problem deleting | 267 // it before deleting the file just in case there is some problem deleting |
269 // the file (e.g. directory is not writable, but file is), which would | 268 // the file (e.g. directory is not writable, but file is), which would |
270 // otherwise cause passwords to re-migrate next (or maybe every) time. | 269 // otherwise cause passwords to re-migrate next (or maybe every) time. |
271 DeleteAndRecreateDatabaseFile(); | 270 DeleteAndRecreateDatabaseFile(); |
272 } | 271 } |
273 } | 272 } |
274 ssize_t result = ok ? forms.size() : -1; | 273 ssize_t result = ok ? forms.size() : -1; |
275 STLDeleteElements(&forms); | 274 STLDeleteElements(&forms); |
276 return result; | 275 return result; |
277 } | 276 } |
OLD | NEW |