OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_SETTINGS_SETTINGS_BACKEND_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_SETTINGS_SETTINGS_BACKEND_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_SETTINGS_SETTINGS_BACKEND_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_SETTINGS_SETTINGS_BACKEND_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
(...skipping 30 matching lines...) Expand all Loading... |
41 SettingsStorage* GetStorage(const std::string& extension_id) const; | 41 SettingsStorage* GetStorage(const std::string& extension_id) const; |
42 | 42 |
43 // Deletes all setting data for an extension. Call on the FILE thread. | 43 // Deletes all setting data for an extension. Call on the FILE thread. |
44 void DeleteStorage(const std::string& extension_id); | 44 void DeleteStorage(const std::string& extension_id); |
45 | 45 |
46 // SyncableService implementation. | 46 // SyncableService implementation. |
47 virtual SyncDataList GetAllSyncData(syncable::ModelType type) const OVERRIDE; | 47 virtual SyncDataList GetAllSyncData(syncable::ModelType type) const OVERRIDE; |
48 virtual SyncError MergeDataAndStartSyncing( | 48 virtual SyncError MergeDataAndStartSyncing( |
49 syncable::ModelType type, | 49 syncable::ModelType type, |
50 const SyncDataList& initial_sync_data, | 50 const SyncDataList& initial_sync_data, |
51 SyncChangeProcessor* sync_processor) OVERRIDE; | 51 scoped_ptr<SyncChangeProcessor> sync_processor) OVERRIDE; |
52 virtual SyncError ProcessSyncChanges( | 52 virtual SyncError ProcessSyncChanges( |
53 const tracked_objects::Location& from_here, | 53 const tracked_objects::Location& from_here, |
54 const SyncChangeList& change_list) OVERRIDE; | 54 const SyncChangeList& change_list) OVERRIDE; |
55 virtual void StopSyncing(syncable::ModelType type) OVERRIDE; | 55 virtual void StopSyncing(syncable::ModelType type) OVERRIDE; |
56 | 56 |
57 private: | 57 private: |
58 // Gets a weak reference to the storage area for a given extension, | 58 // Gets a weak reference to the storage area for a given extension, |
59 // initializing sync with some initial data if sync enabled. | 59 // initializing sync with some initial data if sync enabled. |
60 SyncableSettingsStorage* GetOrCreateStorageWithSyncData( | 60 SyncableSettingsStorage* GetOrCreateStorageWithSyncData( |
61 const std::string& extension_id, | 61 const std::string& extension_id, |
(...skipping 19 matching lines...) Expand all Loading... |
81 // Ensure that there is only ever one created per extension. | 81 // Ensure that there is only ever one created per extension. |
82 typedef std::map<std::string, linked_ptr<SyncableSettingsStorage> > | 82 typedef std::map<std::string, linked_ptr<SyncableSettingsStorage> > |
83 StorageObjMap; | 83 StorageObjMap; |
84 mutable StorageObjMap storage_objs_; | 84 mutable StorageObjMap storage_objs_; |
85 | 85 |
86 // Current sync model type. Will be UNSPECIFIED if sync hasn't been enabled | 86 // Current sync model type. Will be UNSPECIFIED if sync hasn't been enabled |
87 // yet, and either SETTINGS or APP_SETTINGS if it has been. | 87 // yet, and either SETTINGS or APP_SETTINGS if it has been. |
88 syncable::ModelType sync_type_; | 88 syncable::ModelType sync_type_; |
89 | 89 |
90 // Current sync processor, if any. | 90 // Current sync processor, if any. |
91 SyncChangeProcessor* sync_processor_; | 91 scoped_ptr<SyncChangeProcessor> sync_processor_; |
92 | 92 |
93 DISALLOW_COPY_AND_ASSIGN(SettingsBackend); | 93 DISALLOW_COPY_AND_ASSIGN(SettingsBackend); |
94 }; | 94 }; |
95 | 95 |
96 } // namespace extensions | 96 } // namespace extensions |
97 | 97 |
98 #endif // CHROME_BROWSER_EXTENSIONS_SETTINGS_SETTINGS_BACKEND_H_ | 98 #endif // CHROME_BROWSER_EXTENSIONS_SETTINGS_SETTINGS_BACKEND_H_ |
OLD | NEW |