1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef COMPONENTS_WIFI_SYNC_WIFI_CREDENTIAL_SYNCABLE_SERVICE_H_
6 #define COMPONENTS_WIFI_SYNC_WIFI_CREDENTIAL_SYNCABLE_SERVICE_H_
8 #include "base/macros.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "components/keyed_service/core/keyed_service.h"
11 #include "sync/api/sync_change_processor.h"
12 #include "sync/api/syncable_service.h"
16 // KeyedService that synchronizes WiFi credentials between local settings,
19 // This service does not necessarily own the storage for WiFi
20 // credentials. In particular, on ChromeOS, WiFi credential storage is
21 // managed by the ChromeOS connection manager ("Shill").
22 class WifiCredentialSyncableService
23 : public syncer::SyncableService
, public KeyedService
{
25 WifiCredentialSyncableService();
26 ~WifiCredentialSyncableService() override
;
28 // syncer::SyncableService implementation.
29 syncer::SyncMergeResult
MergeDataAndStartSyncing(
30 syncer::ModelType type
,
31 const syncer::SyncDataList
& initial_sync_data
,
32 scoped_ptr
<syncer::SyncChangeProcessor
> sync_processor
,
33 scoped_ptr
<syncer::SyncErrorFactory
> error_handler
) override
;
34 void StopSyncing(syncer::ModelType type
) override
;
35 syncer::SyncDataList
GetAllSyncData(syncer::ModelType type
) const override
;
36 syncer::SyncError
ProcessSyncChanges(
37 const tracked_objects::Location
& caller_location
,
38 const syncer::SyncChangeList
& change_list
) override
;
41 // The syncer::ModelType that this SyncableService processes and
42 // generates updates for.
43 static const syncer::ModelType kModelType
;
45 // Our SyncChangeProcessor instance. Used to push changes into
47 scoped_ptr
<syncer::SyncChangeProcessor
> sync_processor_
;
49 DISALLOW_COPY_AND_ASSIGN(WifiCredentialSyncableService
);
52 } // namespace wifi_sync
54 #endif // COMPONENTS_WIFI_SYNC_WIFI_CREDENTIAL_SYNCABLE_SERVICE_H_