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

Side by Side Diff: components/password_manager/core/browser/password_store_default.cc

Issue 299443002: Password Login Database: report correct changes from UpdateLogin(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added UpdateNonexistentLogin tests Created 6 years, 7 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
« no previous file with comments | « components/password_manager/core/browser/password_form_manager_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "components/password_manager/core/browser/password_store_default.h" 5 #include "components/password_manager/core/browser/password_store_default.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/prefs/pref_service.h" 10 #include "base/prefs/pref_service.h"
(...skipping 22 matching lines...) Expand all
33 33
34 PasswordStoreChangeList PasswordStoreDefault::AddLoginImpl( 34 PasswordStoreChangeList PasswordStoreDefault::AddLoginImpl(
35 const PasswordForm& form) { 35 const PasswordForm& form) {
36 DCHECK(GetBackgroundTaskRunner()->BelongsToCurrentThread()); 36 DCHECK(GetBackgroundTaskRunner()->BelongsToCurrentThread());
37 return login_db_->AddLogin(form); 37 return login_db_->AddLogin(form);
38 } 38 }
39 39
40 PasswordStoreChangeList PasswordStoreDefault::UpdateLoginImpl( 40 PasswordStoreChangeList PasswordStoreDefault::UpdateLoginImpl(
41 const PasswordForm& form) { 41 const PasswordForm& form) {
42 DCHECK(GetBackgroundTaskRunner()->BelongsToCurrentThread()); 42 DCHECK(GetBackgroundTaskRunner()->BelongsToCurrentThread());
43 PasswordStoreChangeList changes; 43 return login_db_->UpdateLogin(form);
44 if (login_db_->UpdateLogin(form, NULL))
45 changes.push_back(PasswordStoreChange(PasswordStoreChange::UPDATE, form));
46 return changes;
47 } 44 }
48 45
49 PasswordStoreChangeList PasswordStoreDefault::RemoveLoginImpl( 46 PasswordStoreChangeList PasswordStoreDefault::RemoveLoginImpl(
50 const PasswordForm& form) { 47 const PasswordForm& form) {
51 DCHECK(GetBackgroundTaskRunner()->BelongsToCurrentThread()); 48 DCHECK(GetBackgroundTaskRunner()->BelongsToCurrentThread());
52 PasswordStoreChangeList changes; 49 PasswordStoreChangeList changes;
53 if (login_db_->RemoveLogin(form)) 50 if (login_db_->RemoveLogin(form))
54 changes.push_back(PasswordStoreChange(PasswordStoreChange::REMOVE, form)); 51 changes.push_back(PasswordStoreChange(PasswordStoreChange::REMOVE, form));
55 return changes; 52 return changes;
56 } 53 }
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 return login_db_->GetAutofillableLogins(forms); 97 return login_db_->GetAutofillableLogins(forms);
101 } 98 }
102 99
103 bool PasswordStoreDefault::FillBlacklistLogins( 100 bool PasswordStoreDefault::FillBlacklistLogins(
104 std::vector<PasswordForm*>* forms) { 101 std::vector<PasswordForm*>* forms) {
105 DCHECK(GetBackgroundTaskRunner()->BelongsToCurrentThread()); 102 DCHECK(GetBackgroundTaskRunner()->BelongsToCurrentThread());
106 return login_db_->GetBlacklistLogins(forms); 103 return login_db_->GetBlacklistLogins(forms);
107 } 104 }
108 105
109 } // namespace password_manager 106 } // namespace password_manager
OLDNEW
« no previous file with comments | « components/password_manager/core/browser/password_form_manager_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698