OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_SYNC_GLUE_PASSWORD_MODEL_ASSOCIATOR_H_ | 5 #ifndef CHROME_BROWSER_SYNC_GLUE_PASSWORD_MODEL_ASSOCIATOR_H_ |
6 #define CHROME_BROWSER_SYNC_GLUE_PASSWORD_MODEL_ASSOCIATOR_H_ | 6 #define CHROME_BROWSER_SYNC_GLUE_PASSWORD_MODEL_ASSOCIATOR_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 // Contains all model association related logic: | 43 // Contains all model association related logic: |
44 // * Algorithm to associate password model and sync model. | 44 // * Algorithm to associate password model and sync model. |
45 // * Persisting model associations and loading them back. | 45 // * Persisting model associations and loading them back. |
46 // We do not check if we have local data before this runs; we always | 46 // We do not check if we have local data before this runs; we always |
47 // merge and sync. | 47 // merge and sync. |
48 class PasswordModelAssociator | 48 class PasswordModelAssociator |
49 : public PerDataTypeAssociatorInterface<std::string, std::string> { | 49 : public PerDataTypeAssociatorInterface<std::string, std::string> { |
50 public: | 50 public: |
51 typedef std::vector<webkit_glue::PasswordForm> PasswordVector; | 51 typedef std::vector<webkit_glue::PasswordForm> PasswordVector; |
52 | 52 |
53 static syncable::ModelType model_type() { return syncable::PASSWORD; } | 53 static syncable::ModelType model_type() { return syncable::PASSWORDS; } |
54 PasswordModelAssociator(ProfileSyncService* sync_service, | 54 PasswordModelAssociator(ProfileSyncService* sync_service, |
55 PasswordStore* password_store, | 55 PasswordStore* password_store, |
56 UnrecoverableErrorHandler* error_handler); | 56 UnrecoverableErrorHandler* error_handler); |
57 virtual ~PasswordModelAssociator() { } | 57 virtual ~PasswordModelAssociator() { } |
58 | 58 |
59 // PerDataTypeAssociatorInterface implementation. | 59 // PerDataTypeAssociatorInterface implementation. |
60 // | 60 // |
61 // Iterates through the sync model looking for matched pairs of items. | 61 // Iterates through the sync model looking for matched pairs of items. |
62 virtual bool AssociateModels(); | 62 virtual bool AssociateModels(); |
63 | 63 |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 | 149 |
150 PasswordToSyncIdMap id_map_; | 150 PasswordToSyncIdMap id_map_; |
151 SyncIdToPasswordMap id_map_inverse_; | 151 SyncIdToPasswordMap id_map_inverse_; |
152 | 152 |
153 DISALLOW_COPY_AND_ASSIGN(PasswordModelAssociator); | 153 DISALLOW_COPY_AND_ASSIGN(PasswordModelAssociator); |
154 }; | 154 }; |
155 | 155 |
156 } // namespace browser_sync | 156 } // namespace browser_sync |
157 | 157 |
158 #endif // CHROME_BROWSER_SYNC_GLUE_PASSWORD_MODEL_ASSOCIATOR_H_ | 158 #endif // CHROME_BROWSER_SYNC_GLUE_PASSWORD_MODEL_ASSOCIATOR_H_ |
OLD | NEW |