| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef CHROME_BROWSER_WEBDATA_AUTOCOMPLETE_SYNCABLE_SERVICE_H_ | 4 #ifndef CHROME_BROWSER_WEBDATA_AUTOCOMPLETE_SYNCABLE_SERVICE_H_ |
| 5 #define CHROME_BROWSER_WEBDATA_AUTOCOMPLETE_SYNCABLE_SERVICE_H_ | 5 #define CHROME_BROWSER_WEBDATA_AUTOCOMPLETE_SYNCABLE_SERVICE_H_ |
| 6 #pragma once | 6 #pragma once |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> |
| 9 #include <string> | 10 #include <string> |
| 10 #include <utility> | 11 #include <utility> |
| 11 #include <vector> | 12 #include <vector> |
| 12 | 13 |
| 13 #include "base/basictypes.h" | 14 #include "base/basictypes.h" |
| 14 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
| 15 #include "base/threading/non_thread_safe.h" | 16 #include "base/threading/non_thread_safe.h" |
| 16 #include "chrome/browser/sync/api/sync_change.h" | 17 #include "chrome/browser/sync/api/sync_change.h" |
| 17 #include "chrome/browser/sync/api/sync_data.h" | 18 #include "chrome/browser/sync/api/sync_data.h" |
| 18 #include "chrome/browser/sync/api/sync_error.h" | 19 #include "chrome/browser/sync/api/sync_error.h" |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 | 112 |
| 112 static std::string KeyToTag(const std::string& name, | 113 static std::string KeyToTag(const std::string& name, |
| 113 const std::string& value); | 114 const std::string& value); |
| 114 | 115 |
| 115 // For unit-tests. | 116 // For unit-tests. |
| 116 AutocompleteSyncableService(); | 117 AutocompleteSyncableService(); |
| 117 void set_sync_processor(SyncChangeProcessor* sync_processor) { | 118 void set_sync_processor(SyncChangeProcessor* sync_processor) { |
| 118 sync_processor_.reset(sync_processor); | 119 sync_processor_.reset(sync_processor); |
| 119 } | 120 } |
| 120 | 121 |
| 122 // Ignore deletions of the following keys as they were never synced. |
| 123 std::set<AutofillKey> keys_to_ignore_; |
| 124 |
| 121 // Lifetime of AutocompleteSyncableService object is shorter than | 125 // Lifetime of AutocompleteSyncableService object is shorter than |
| 122 // |web_data_service_| passed to it. | 126 // |web_data_service_| passed to it. |
| 123 WebDataService* web_data_service_; | 127 WebDataService* web_data_service_; |
| 124 content::NotificationRegistrar notification_registrar_; | 128 content::NotificationRegistrar notification_registrar_; |
| 125 | 129 |
| 126 // We receive ownership of |sync_processor_| in MergeDataAndStartSyncing() and | 130 // We receive ownership of |sync_processor_| in MergeDataAndStartSyncing() and |
| 127 // destroy it in StopSyncing(). | 131 // destroy it in StopSyncing(). |
| 128 scoped_ptr<SyncChangeProcessor> sync_processor_; | 132 scoped_ptr<SyncChangeProcessor> sync_processor_; |
| 129 | 133 |
| 130 DISALLOW_COPY_AND_ASSIGN(AutocompleteSyncableService); | 134 DISALLOW_COPY_AND_ASSIGN(AutocompleteSyncableService); |
| 131 }; | 135 }; |
| 132 | 136 |
| 133 #endif // CHROME_BROWSER_WEBDATA_AUTOCOMPLETE_SYNCABLE_SERVICE_H_ | 137 #endif // CHROME_BROWSER_WEBDATA_AUTOCOMPLETE_SYNCABLE_SERVICE_H_ |
| OLD | NEW |