OLD | NEW |
(Empty) | |
| 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. |
| 4 |
| 5 #include "components/wifi_sync/wifi_credential_syncable_service.h" |
| 6 |
| 7 namespace wifi_sync { |
| 8 |
| 9 // static |
| 10 const enum syncer::ModelType WifiCredentialSyncableService::kModelType = |
| 11 syncer::WIFI_CREDENTIALS; |
| 12 |
| 13 WifiCredentialSyncableService::WifiCredentialSyncableService( |
| 14 content::BrowserContext *context) : |
| 15 browser_context_(context), |
| 16 thread_checker_() { |
| 17 } |
| 18 |
| 19 WifiCredentialSyncableService::~WifiCredentialSyncableService() { |
| 20 DCHECK(thread_checker_.CalledOnValidThread()); |
| 21 } |
| 22 |
| 23 // Implementation of syncer::SyncableService API. |
| 24 syncer::SyncMergeResult WifiCredentialSyncableService::MergeDataAndStartSyncing( |
| 25 syncer::ModelType type, |
| 26 const syncer::SyncDataList& initial_sync_data, |
| 27 scoped_ptr<syncer::SyncChangeProcessor> sync_processor, |
| 28 scoped_ptr<syncer::SyncErrorFactory> error_handler) { |
| 29 DCHECK(thread_checker_.CalledOnValidThread()); |
| 30 DCHECK(!sync_processor_.get()); |
| 31 DCHECK(sync_processor.get()); |
| 32 DCHECK(error_handler.get()); |
| 33 DCHECK_EQ(kModelType, type); |
| 34 |
| 35 sync_processor_ = sync_processor.Pass(); |
| 36 sync_error_handler_ = error_handler.Pass(); |
| 37 |
| 38 return syncer::SyncMergeResult(type); |
| 39 } |
| 40 |
| 41 void WifiCredentialSyncableService::StopSyncing(syncer::ModelType type) { |
| 42 DCHECK(thread_checker_.CalledOnValidThread()); |
| 43 DCHECK_EQ(kModelType, type); |
| 44 sync_processor_.reset(); |
| 45 sync_error_handler_.reset(); |
| 46 } |
| 47 |
| 48 syncer::SyncDataList WifiCredentialSyncableService::GetAllSyncData( |
| 49 syncer::ModelType type) const { |
| 50 DCHECK(thread_checker_.CalledOnValidThread()); |
| 51 DCHECK_EQ(kModelType, type); |
| 52 NOTIMPLEMENTED(); |
| 53 return syncer::SyncDataList(); |
| 54 } |
| 55 |
| 56 syncer::SyncError WifiCredentialSyncableService::ProcessSyncChanges( |
| 57 const tracked_objects::Location& from_here, |
| 58 const syncer::SyncChangeList& change_list) { |
| 59 DCHECK(thread_checker_.CalledOnValidThread()); |
| 60 NOTIMPLEMENTED(); |
| 61 return syncer::SyncError(); |
| 62 } |
| 63 |
| 64 // Test support. |
| 65 std::set<std::pair<std::vector<char>, WifiSecurityClass>> |
| 66 WifiCredentialSyncableService::GetWifiNetworksForTest() const { |
| 67 return std::set<std::pair<std::vector<char>, WifiSecurityClass>>(); |
| 68 } |
| 69 |
| 70 } // namespace wifi_sync |
OLD | NEW |