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..0f934f3a804eebb397e33a8e69604111060501b8 |
--- /dev/null |
+++ b/components/wifi_sync/wifi_credential_syncable_service.h |
@@ -0,0 +1,63 @@ |
+// Copyright (c) 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 <string> |
+#include <vector> |
+ |
+#include "components/keyed_service/core/keyed_service.h" |
+#include "components/wifi_sync/wifi_security_class.h" |
+#include "sync/api/sync_change.h" |
+#include "sync/api/sync_data.h" |
+#include "sync/api/sync_error.h" |
+#include "sync/api/sync_error_factory.h" |
+#include "sync/api/syncable_service.h" |
+ |
+namespace content { |
+class BrowserContext; |
+} // content |
+ |
+namespace wifi_sync { |
+ |
+class WifiCredentialSyncableService |
+ : public syncer::SyncableService, public KeyedService { |
+ public: |
+ explicit WifiCredentialSyncableService(content::BrowserContext *context); |
+ virtual ~WifiCredentialSyncableService(); |
stevenjb
2014/10/28 21:17:31
new style is:
~WifiCredentialSyncableService() ove
mukesh agrawal
2014/10/29 00:41:34
Done.
|
+ |
+ // syncer::SyncableService implementation. |
+ virtual 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; |
+ virtual void StopSyncing(syncer::ModelType type) override; |
+ virtual syncer::SyncDataList GetAllSyncData( |
+ syncer::ModelType type) const override; |
+ virtual syncer::SyncError ProcessSyncChanges( |
+ const tracked_objects::Location& from_here, |
+ const syncer::SyncChangeList& change_list) override; |
+ |
+ // Called from UI layer. |
+ virtual bool IsRunning(); |
stevenjb
2014/10/28 21:17:31
nit: New virtuals should probably be declared firs
mukesh agrawal
2014/10/29 00:41:34
I actually don't know why I made these virtual, so
stevenjb
2014/10/29 17:49:45
I personally tend to put new public methods above
|
+ virtual void AddToSyncedNetworks( |
+ const std::string& item_id, |
+ const std::vector<unsigned char>& ssid, |
+ WifiSecurityClass security_class, |
+ const std::string& passphrase); |
+ virtual void RemoveFromSyncedNetworks(const std::string& item_id); |
+ static const char* GetNormalizedSecurityClass( |
+ WifiSecurityClass security_class); |
+ |
+ private: |
+ content::BrowserContext *browser_context_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(WifiCredentialSyncableService); |
+}; |
+ |
+} // namespace wifi_sync |
+ |
+#endif // COMPONENTS_WIFI_SYNC_WIFI_CREDENTIAL_SYNCABLE_SERVICE_H_ |