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

Side by Side Diff: chrome/browser/webdata/autocomplete_syncable_service.h

Issue 12494020: Remove knowledge of Chrome-specific SyncableService classes from WebDataService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 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 (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 #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 6
7 #include <map> 7 #include <map>
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 29 matching lines...) Expand all
40 // TODO(georgey) : remove reliance on the notifications and make it to be called 40 // TODO(georgey) : remove reliance on the notifications and make it to be called
41 // from web_data_service directly. 41 // from web_data_service directly.
42 class AutocompleteSyncableService 42 class AutocompleteSyncableService
43 : public syncer::SyncableService, 43 : public syncer::SyncableService,
44 public content::NotificationObserver, 44 public content::NotificationObserver,
45 public base::NonThreadSafe { 45 public base::NonThreadSafe {
46 public: 46 public:
47 explicit AutocompleteSyncableService(WebDataService* web_data_service); 47 explicit AutocompleteSyncableService(WebDataService* web_data_service);
48 virtual ~AutocompleteSyncableService(); 48 virtual ~AutocompleteSyncableService();
49 49
50 // Retrieves the AutocompleteSyncableService stored on |web_data|.
51 static AutocompleteSyncableService* FromWebData(WebDataServiceBase* web_data);
52
53 // Attaches |service| to |web_data|, transferring ownership to |web_data|.
54 static void AttachToWebData(scoped_ptr<AutocompleteSyncableService> service,
55 WebDataServiceBase* web_data);
Ilya Sherman 2013/03/18 21:24:48 Why not follow the pattern used elsewhere in the A
Jói 2013/03/18 22:11:34 I was aware of the pattern but didn't think to app
56
50 static syncer::ModelType model_type() { return syncer::AUTOFILL; } 57 static syncer::ModelType model_type() { return syncer::AUTOFILL; }
51 58
52 // syncer::SyncableService implementation. 59 // syncer::SyncableService implementation.
53 virtual syncer::SyncMergeResult MergeDataAndStartSyncing( 60 virtual syncer::SyncMergeResult MergeDataAndStartSyncing(
54 syncer::ModelType type, 61 syncer::ModelType type,
55 const syncer::SyncDataList& initial_sync_data, 62 const syncer::SyncDataList& initial_sync_data,
56 scoped_ptr<syncer::SyncChangeProcessor> sync_processor, 63 scoped_ptr<syncer::SyncChangeProcessor> sync_processor,
57 scoped_ptr<syncer::SyncErrorFactory> error_handler) OVERRIDE; 64 scoped_ptr<syncer::SyncErrorFactory> error_handler) OVERRIDE;
58 virtual void StopSyncing(syncer::ModelType type) OVERRIDE; 65 virtual void StopSyncing(syncer::ModelType type) OVERRIDE;
59 virtual syncer::SyncDataList GetAllSyncData( 66 virtual syncer::SyncDataList GetAllSyncData(
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 scoped_ptr<syncer::SyncErrorFactory> error_handler_; 156 scoped_ptr<syncer::SyncErrorFactory> error_handler_;
150 157
151 // Whether we should cull expired autofill entries, can be updated by sync 158 // Whether we should cull expired autofill entries, can be updated by sync
152 // via UpdateCullingSetting. 159 // via UpdateCullingSetting.
153 bool cull_expired_entries_; 160 bool cull_expired_entries_;
154 161
155 DISALLOW_COPY_AND_ASSIGN(AutocompleteSyncableService); 162 DISALLOW_COPY_AND_ASSIGN(AutocompleteSyncableService);
156 }; 163 };
157 164
158 #endif // CHROME_BROWSER_WEBDATA_AUTOCOMPLETE_SYNCABLE_SERVICE_H_ 165 #endif // CHROME_BROWSER_WEBDATA_AUTOCOMPLETE_SYNCABLE_SERVICE_H_
OLDNEW
« no previous file with comments | « chrome/browser/sync/profile_sync_service_autofill_unittest.cc ('k') | chrome/browser/webdata/autocomplete_syncable_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698