OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_SYNCABLE_SERVICE_H__ | 5 #ifndef CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_SYNCABLE_SERVICE_H__ |
6 #define CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_SYNCABLE_SERVICE_H__ | 6 #define CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_SYNCABLE_SERVICE_H__ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
53 // Returns the unique tag that will serve as the sync identifier for the | 53 // Returns the unique tag that will serve as the sync identifier for the |
54 // |password| entry. | 54 // |password| entry. |
55 static std::string MakeTag(const autofill::PasswordForm& password); | 55 static std::string MakeTag(const autofill::PasswordForm& password); |
56 static std::string MakeTag(const sync_pb::PasswordSpecificsData& password); | 56 static std::string MakeTag(const sync_pb::PasswordSpecificsData& password); |
57 static std::string MakeTag(const std::string& origin_url, | 57 static std::string MakeTag(const std::string& origin_url, |
58 const std::string& username_element, | 58 const std::string& username_element, |
59 const std::string& username_value, | 59 const std::string& username_value, |
60 const std::string& password_element, | 60 const std::string& password_element, |
61 const std::string& signon_realm); | 61 const std::string& signon_realm); |
62 | 62 |
63 // Converts the |PasswordForm| to |SyncData| suitable for syncing. | |
Nicolas Zea
2013/10/21 23:55:14
nit: no need to mention suitable for syncing; that
lipalani1
2013/10/24 00:13:58
Done.
| |
64 static syncer::SyncData CreateSyncData( | |
65 const autofill::PasswordForm& password); | |
Nicolas Zea
2013/10/21 23:55:14
nit: fix indent
lipalani1
2013/10/24 00:13:58
Done.
| |
66 static void ExtractPasswordFromSpecifics( | |
67 const sync_pb::PasswordSpecificsData& password, | |
68 autofill::PasswordForm* new_password); | |
69 | |
63 private: | 70 private: |
64 typedef std::vector<autofill::PasswordForm*> PasswordForms; | 71 typedef std::vector<autofill::PasswordForm*> PasswordForms; |
65 | 72 |
73 typedef std::map<std::string, | |
Nicolas Zea
2013/10/21 23:55:14
nit: remove newline above
lipalani1
2013/10/24 00:13:58
Done.
| |
74 std::pair<syncer::SyncChange::SyncChangeType, | |
75 std::vector<autofill::PasswordForm*>::iterator > > | |
76 PasswordEntryMap; | |
77 | |
66 // Use the |PasswordStore| APIs to add and update entries. | 78 // Use the |PasswordStore| APIs to add and update entries. |
67 void WriteToPasswordStore(PasswordForms* new_entries, | 79 void WriteToPasswordStore(PasswordForms* new_entries, |
68 PasswordForms* udpated_entries); | 80 PasswordForms* udpated_entries); |
81 void CreateOrUpdateEntry( | |
Nicolas Zea
2013/10/21 23:55:14
Comment about what function does
lipalani1
2013/10/24 00:13:58
Done.
| |
82 const syncer::SyncData& data, | |
83 PasswordEntryMap* loaded_data, | |
84 ScopedVector<autofill::PasswordForm>* new_entries, | |
85 ScopedVector<autofill::PasswordForm>* udpated_entries); | |
Nicolas Zea
2013/10/21 23:55:14
udpated -> updated
lipalani1
2013/10/24 00:13:58
Done.
| |
69 | 86 |
70 // Converts the |PasswordForm| to |SyncData| suitable for syncing. | 87 // Virtual so tests can override. |
71 syncer::SyncData CreateSyncData(const autofill::PasswordForm& password); | 88 virtual void NotifyPasswordStore(); |
72 | 89 |
73 // The factory that creates sync errors. |SyncError| has rich data | 90 // The factory that creates sync errors. |SyncError| has rich data |
74 // suitable for debugging. | 91 // suitable for debugging. |
75 scoped_ptr<syncer::SyncErrorFactory> sync_error_factory_; | 92 scoped_ptr<syncer::SyncErrorFactory> sync_error_factory_; |
76 | 93 |
77 // |SyncProcessor| will mirror the |PasswordStore| changes in the sync db. | 94 // |SyncProcessor| will mirror the |PasswordStore| changes in the sync db. |
78 scoped_ptr<syncer::SyncChangeProcessor> sync_processor_; | 95 scoped_ptr<syncer::SyncChangeProcessor> sync_processor_; |
79 | 96 |
80 // The password store that adds/updates/deletes password entries. | 97 // The password store that adds/updates/deletes password entries. |
81 scoped_refptr<PasswordStore> password_store_; | 98 scoped_refptr<PasswordStore> password_store_; |
82 }; | 99 }; |
83 | 100 |
84 #endif // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_SYNCABLE_SERVICE_H__ | 101 #endif // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_SYNCABLE_SERVICE_H__ |
85 | 102 |
OLD | NEW |