| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 | 4 |
| 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_STORAGE_SYNC_STORAGE_BACKEND_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_STORAGE_SYNC_STORAGE_BACKEND_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_STORAGE_SYNC_STORAGE_BACKEND_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_STORAGE_SYNC_STORAGE_BACKEND_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 // databases will be at base_path/extension_id. | 38 // databases will be at base_path/extension_id. |
| 39 // |observers| is the list of observers to settings changes. | 39 // |observers| is the list of observers to settings changes. |
| 40 SyncStorageBackend( | 40 SyncStorageBackend( |
| 41 const scoped_refptr<SettingsStorageFactory>& storage_factory, | 41 const scoped_refptr<SettingsStorageFactory>& storage_factory, |
| 42 const base::FilePath& base_path, | 42 const base::FilePath& base_path, |
| 43 const SettingsStorageQuotaEnforcer::Limits& quota, | 43 const SettingsStorageQuotaEnforcer::Limits& quota, |
| 44 const scoped_refptr<SettingsObserverList>& observers, | 44 const scoped_refptr<SettingsObserverList>& observers, |
| 45 syncer::ModelType sync_type, | 45 syncer::ModelType sync_type, |
| 46 const syncer::SyncableService::StartSyncFlare& flare); | 46 const syncer::SyncableService::StartSyncFlare& flare); |
| 47 | 47 |
| 48 virtual ~SyncStorageBackend(); | 48 ~SyncStorageBackend() override; |
| 49 | 49 |
| 50 virtual ValueStore* GetStorage(const std::string& extension_id); | 50 virtual ValueStore* GetStorage(const std::string& extension_id); |
| 51 virtual void DeleteStorage(const std::string& extension_id); | 51 virtual void DeleteStorage(const std::string& extension_id); |
| 52 | 52 |
| 53 // syncer::SyncableService implementation. | 53 // syncer::SyncableService implementation. |
| 54 virtual syncer::SyncDataList GetAllSyncData(syncer::ModelType type) | 54 syncer::SyncDataList GetAllSyncData(syncer::ModelType type) const override; |
| 55 const override; | 55 syncer::SyncMergeResult MergeDataAndStartSyncing( |
| 56 virtual syncer::SyncMergeResult MergeDataAndStartSyncing( | |
| 57 syncer::ModelType type, | 56 syncer::ModelType type, |
| 58 const syncer::SyncDataList& initial_sync_data, | 57 const syncer::SyncDataList& initial_sync_data, |
| 59 scoped_ptr<syncer::SyncChangeProcessor> sync_processor, | 58 scoped_ptr<syncer::SyncChangeProcessor> sync_processor, |
| 60 scoped_ptr<syncer::SyncErrorFactory> sync_error_factory) override; | 59 scoped_ptr<syncer::SyncErrorFactory> sync_error_factory) override; |
| 61 virtual syncer::SyncError ProcessSyncChanges( | 60 syncer::SyncError ProcessSyncChanges( |
| 62 const tracked_objects::Location& from_here, | 61 const tracked_objects::Location& from_here, |
| 63 const syncer::SyncChangeList& change_list) override; | 62 const syncer::SyncChangeList& change_list) override; |
| 64 virtual void StopSyncing(syncer::ModelType type) override; | 63 void StopSyncing(syncer::ModelType type) override; |
| 65 | 64 |
| 66 private: | 65 private: |
| 67 // Gets a weak reference to the storage area for a given extension, | 66 // Gets a weak reference to the storage area for a given extension, |
| 68 // initializing sync with some initial data if sync enabled. | 67 // initializing sync with some initial data if sync enabled. |
| 69 SyncableSettingsStorage* GetOrCreateStorageWithSyncData( | 68 SyncableSettingsStorage* GetOrCreateStorageWithSyncData( |
| 70 const std::string& extension_id, | 69 const std::string& extension_id, |
| 71 const base::DictionaryValue& sync_data) const; | 70 const base::DictionaryValue& sync_data) const; |
| 72 | 71 |
| 73 // Gets all extension IDs known to extension settings. This may not be all | 72 // Gets all extension IDs known to extension settings. This may not be all |
| 74 // installed extensions. | 73 // installed extensions. |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 scoped_ptr<syncer::SyncErrorFactory> sync_error_factory_; | 105 scoped_ptr<syncer::SyncErrorFactory> sync_error_factory_; |
| 107 | 106 |
| 108 syncer::SyncableService::StartSyncFlare flare_; | 107 syncer::SyncableService::StartSyncFlare flare_; |
| 109 | 108 |
| 110 DISALLOW_COPY_AND_ASSIGN(SyncStorageBackend); | 109 DISALLOW_COPY_AND_ASSIGN(SyncStorageBackend); |
| 111 }; | 110 }; |
| 112 | 111 |
| 113 } // namespace extensions | 112 } // namespace extensions |
| 114 | 113 |
| 115 #endif // CHROME_BROWSER_EXTENSIONS_API_STORAGE_SYNC_STORAGE_BACKEND_H_ | 114 #endif // CHROME_BROWSER_EXTENSIONS_API_STORAGE_SYNC_STORAGE_BACKEND_H_ |
| OLD | NEW |