| 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 #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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 // Contains all model association related logic: | 40 // Contains all model association related logic: |
| 41 // * Algorithm to associate password model and sync model. | 41 // * Algorithm to associate password model and sync model. |
| 42 // * Persisting model associations and loading them back. | 42 // * Persisting model associations and loading them back. |
| 43 // We do not check if we have local data before this runs; we always | 43 // We do not check if we have local data before this runs; we always |
| 44 // merge and sync. | 44 // merge and sync. |
| 45 class PasswordModelAssociator | 45 class PasswordModelAssociator |
| 46 : public PerDataTypeAssociatorInterface<std::string, std::string> { | 46 : public PerDataTypeAssociatorInterface<std::string, std::string> { |
| 47 public: | 47 public: |
| 48 typedef std::vector<webkit::forms::PasswordForm> PasswordVector; | 48 typedef std::vector<webkit::forms::PasswordForm> PasswordVector; |
| 49 | 49 |
| 50 static syncable::ModelType model_type() { return syncable::PASSWORDS; } | 50 static syncer::ModelType model_type() { return syncer::PASSWORDS; } |
| 51 PasswordModelAssociator(ProfileSyncService* sync_service, | 51 PasswordModelAssociator(ProfileSyncService* sync_service, |
| 52 PasswordStore* password_store, | 52 PasswordStore* password_store, |
| 53 DataTypeErrorHandler* error_handler); | 53 DataTypeErrorHandler* error_handler); |
| 54 virtual ~PasswordModelAssociator(); | 54 virtual ~PasswordModelAssociator(); |
| 55 | 55 |
| 56 // PerDataTypeAssociatorInterface implementation. | 56 // PerDataTypeAssociatorInterface implementation. |
| 57 // | 57 // |
| 58 // Iterates through the sync model looking for matched pairs of items. | 58 // Iterates through the sync model looking for matched pairs of items. |
| 59 virtual syncer::SyncError AssociateModels() OVERRIDE; | 59 virtual syncer::SyncError AssociateModels() OVERRIDE; |
| 60 | 60 |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 PasswordToSyncIdMap id_map_; | 139 PasswordToSyncIdMap id_map_; |
| 140 SyncIdToPasswordMap id_map_inverse_; | 140 SyncIdToPasswordMap id_map_inverse_; |
| 141 DataTypeErrorHandler* error_handler_; | 141 DataTypeErrorHandler* error_handler_; |
| 142 | 142 |
| 143 DISALLOW_COPY_AND_ASSIGN(PasswordModelAssociator); | 143 DISALLOW_COPY_AND_ASSIGN(PasswordModelAssociator); |
| 144 }; | 144 }; |
| 145 | 145 |
| 146 } // namespace browser_sync | 146 } // namespace browser_sync |
| 147 | 147 |
| 148 #endif // CHROME_BROWSER_SYNC_GLUE_PASSWORD_MODEL_ASSOCIATOR_H_ | 148 #endif // CHROME_BROWSER_SYNC_GLUE_PASSWORD_MODEL_ASSOCIATOR_H_ |
| OLD | NEW |