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

Side by Side Diff: components/password_manager/core/browser/login_database.h

Issue 283563002: Password Login Database: report correct changes from AddLogin(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed PasswordSyncableServiceTest.PasswordStoreChanges 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
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 #ifndef COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_LOGIN_DATABASE_H_ 5 #ifndef COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_LOGIN_DATABASE_H_
6 #define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_LOGIN_DATABASE_H_ 6 #define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_LOGIN_DATABASE_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/files/file_path.h" 11 #include "base/files/file_path.h"
12 #include "base/pickle.h" 12 #include "base/pickle.h"
13 #include "base/strings/string16.h" 13 #include "base/strings/string16.h"
14 #include "components/password_manager/core/browser/password_store_change.h"
14 #include "components/password_manager/core/browser/psl_matching_helper.h" 15 #include "components/password_manager/core/browser/psl_matching_helper.h"
15 #include "sql/connection.h" 16 #include "sql/connection.h"
16 #include "sql/meta_table.h" 17 #include "sql/meta_table.h"
17 18
18 namespace autofill {
19 struct PasswordForm;
20 } // namespace autofill
21
22 namespace password_manager { 19 namespace password_manager {
23 20
24 // Interface to the database storage of login information, intended as a helper 21 // Interface to the database storage of login information, intended as a helper
25 // for PasswordStore on platforms that need internal storage of some or all of 22 // for PasswordStore on platforms that need internal storage of some or all of
26 // the login information. 23 // the login information.
27 class LoginDatabase { 24 class LoginDatabase {
28 public: 25 public:
29 LoginDatabase(); 26 LoginDatabase();
30 virtual ~LoginDatabase(); 27 virtual ~LoginDatabase();
31 28
32 // Initialize the database with an sqlite file at the given path. 29 // Initialize the database with an sqlite file at the given path.
33 // If false is returned, no other method should be called. 30 // If false is returned, no other method should be called.
34 bool Init(const base::FilePath& db_path); 31 bool Init(const base::FilePath& db_path);
35 32
36 // Reports usage metrics to UMA. 33 // Reports usage metrics to UMA.
37 void ReportMetrics(); 34 void ReportMetrics();
38 35
39 // Adds |form| to the list of remembered password forms. 36 // Adds |form| to the list of remembered password forms. Returns the list of
40 bool AddLogin(const autofill::PasswordForm& form); 37 // changes applied ({}, {ADD}, {DELETE, ADD}). In the latter case the previous
Garrett Casto 2014/05/14 07:46:35 nit: It's REMOVE not DELETE.
vasilii 2014/05/14 11:20:18 Done.
38 // password value isn't read. Thus only the UNIQUE key columns contain the
Garrett Casto 2014/05/14 07:46:35 The last two sentences are pretty confusing. I thi
vasilii 2014/05/14 11:20:18 Done.
39 // correct value.
40 PasswordStoreChangeList AddLogin(const autofill::PasswordForm& form);
41 41
42 // Updates remembered password form. Returns true on success and sets 42 // Updates remembered password form. Returns true on success and sets
43 // items_changed (if non-NULL) to the number of logins updated. 43 // items_changed (if non-NULL) to the number of logins updated.
44 bool UpdateLogin(const autofill::PasswordForm& form, int* items_changed); 44 bool UpdateLogin(const autofill::PasswordForm& form, int* items_changed);
45 45
46 // Removes |form| from the list of remembered password forms. 46 // Removes |form| from the list of remembered password forms.
47 bool RemoveLogin(const autofill::PasswordForm& form); 47 bool RemoveLogin(const autofill::PasswordForm& form);
48 48
49 // Removes all logins created from |delete_begin| onwards (inclusive) and 49 // Removes all logins created from |delete_begin| onwards (inclusive) and
50 // before |delete_end|. You may use a null Time value to do an unbounded 50 // before |delete_end|. You may use a null Time value to do an unbounded
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 sql::MetaTable meta_table_; 137 sql::MetaTable meta_table_;
138 138
139 PSLMatchingHelper psl_helper_; 139 PSLMatchingHelper psl_helper_;
140 140
141 DISALLOW_COPY_AND_ASSIGN(LoginDatabase); 141 DISALLOW_COPY_AND_ASSIGN(LoginDatabase);
142 }; 142 };
143 143
144 } // namespace password_manager 144 } // namespace password_manager
145 145
146 #endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_LOGIN_DATABASE_H_ 146 #endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_LOGIN_DATABASE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698