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

Unified Diff: components/wifi_sync/wifi_credential_syncable_service.h

Issue 709683004: components: add wifi_sync component (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@submit-1-security-class
Patch Set: fix android_aosp build Created 6 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/wifi_sync/wifi_credential.cc ('k') | components/wifi_sync/wifi_credential_syncable_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/wifi_sync/wifi_credential_syncable_service.h
diff --git a/components/wifi_sync/wifi_credential_syncable_service.h b/components/wifi_sync/wifi_credential_syncable_service.h
new file mode 100644
index 0000000000000000000000000000000000000000..fbd82f4bf1fbe1b79251302789b8ab73b0e83e53
--- /dev/null
+++ b/components/wifi_sync/wifi_credential_syncable_service.h
@@ -0,0 +1,54 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef COMPONENTS_WIFI_SYNC_WIFI_CREDENTIAL_SYNCABLE_SERVICE_H_
+#define COMPONENTS_WIFI_SYNC_WIFI_CREDENTIAL_SYNCABLE_SERVICE_H_
+
+#include "base/macros.h"
+#include "base/memory/scoped_ptr.h"
+#include "components/keyed_service/core/keyed_service.h"
+#include "sync/api/sync_change_processor.h"
+#include "sync/api/syncable_service.h"
+
+namespace wifi_sync {
+
+// KeyedService that synchronizes WiFi credentials between local settings,
+// and Chrome Sync.
+//
+// This service does not necessarily own the storage for WiFi
+// credentials. In particular, on ChromeOS, WiFi credential storage is
+// managed by the ChromeOS connection manager ("Shill").
+class WifiCredentialSyncableService
+ : public syncer::SyncableService, public KeyedService {
+ public:
+ WifiCredentialSyncableService();
+ ~WifiCredentialSyncableService() override;
+
+ // syncer::SyncableService implementation.
+ syncer::SyncMergeResult MergeDataAndStartSyncing(
+ syncer::ModelType type,
+ const syncer::SyncDataList& initial_sync_data,
+ scoped_ptr<syncer::SyncChangeProcessor> sync_processor,
+ scoped_ptr<syncer::SyncErrorFactory> error_handler) override;
+ void StopSyncing(syncer::ModelType type) override;
+ syncer::SyncDataList GetAllSyncData(syncer::ModelType type) const override;
+ syncer::SyncError ProcessSyncChanges(
+ const tracked_objects::Location& caller_location,
+ const syncer::SyncChangeList& change_list) override;
+
+ private:
+ // The syncer::ModelType that this SyncableService processes and
+ // generates updates for.
+ static const syncer::ModelType kModelType;
+
+ // Our SyncChangeProcessor instance. Used to push changes into
+ // Chrome Sync.
+ scoped_ptr<syncer::SyncChangeProcessor> sync_processor_;
+
+ DISALLOW_COPY_AND_ASSIGN(WifiCredentialSyncableService);
+};
+
+} // namespace wifi_sync
+
+#endif // COMPONENTS_WIFI_SYNC_WIFI_CREDENTIAL_SYNCABLE_SERVICE_H_
« no previous file with comments | « components/wifi_sync/wifi_credential.cc ('k') | components/wifi_sync/wifi_credential_syncable_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698