OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_SYNCABLE_SETTINGS_STORAGE_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_SETTINGS_SYNCABLE_SETTINGS_STORAGE_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_SETTINGS_SYNCABLE_SETTINGS_STORAGE_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_SETTINGS_SYNCABLE_SETTINGS_STORAGE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 const std::string& extension_id, | 27 const std::string& extension_id, |
28 // Ownership taken. | 28 // Ownership taken. |
29 SettingsStorage* delegate); | 29 SettingsStorage* delegate); |
30 | 30 |
31 virtual ~SyncableSettingsStorage(); | 31 virtual ~SyncableSettingsStorage(); |
32 | 32 |
33 // SettingsStorage implementation. | 33 // SettingsStorage implementation. |
34 virtual ReadResult Get(const std::string& key) OVERRIDE; | 34 virtual ReadResult Get(const std::string& key) OVERRIDE; |
35 virtual ReadResult Get(const std::vector<std::string>& keys) OVERRIDE; | 35 virtual ReadResult Get(const std::vector<std::string>& keys) OVERRIDE; |
36 virtual ReadResult Get() OVERRIDE; | 36 virtual ReadResult Get() OVERRIDE; |
37 virtual WriteResult Set(const std::string& key, const Value& value) OVERRIDE; | 37 virtual WriteResult Set( |
38 virtual WriteResult Set(const DictionaryValue& settings) OVERRIDE; | 38 WriteOptions options, |
39 virtual WriteResult Remove(const std::string& key) OVERRIDE; | 39 const std::string& key, |
40 virtual WriteResult Remove(const std::vector<std::string>& keys) OVERRIDE; | 40 const Value& value) OVERRIDE; |
41 virtual WriteResult Clear() OVERRIDE; | 41 virtual WriteResult Set( |
| 42 WriteOptions options, const DictionaryValue& values) OVERRIDE; |
| 43 virtual WriteResult Remove( |
| 44 WriteOptions options, const std::string& key) OVERRIDE; |
| 45 virtual WriteResult Remove( |
| 46 WriteOptions options, const std::vector<std::string>& keys) OVERRIDE; |
| 47 virtual WriteResult Clear(WriteOptions options) OVERRIDE; |
42 | 48 |
43 // Sync-related methods, analogous to those on SyncableService (handled by | 49 // Sync-related methods, analogous to those on SyncableService (handled by |
44 // ExtensionSettings), but with looser guarantees about when the methods | 50 // ExtensionSettings), but with looser guarantees about when the methods |
45 // can be called. | 51 // can be called. |
46 | 52 |
47 // Must only be called if sync isn't already active; not idempotent since | 53 // Must only be called if sync isn't already active; not idempotent since |
48 // behaviour would be undefined given differerent values of |sync_state|. | 54 // behaviour would be undefined given differerent values of |sync_state|. |
49 SyncError StartSyncing( | 55 SyncError StartSyncing( |
50 // Either SETTINGS or APP_SETTINGS. | 56 // Either SETTINGS or APP_SETTINGS. |
51 syncable::ModelType type, | 57 syncable::ModelType type, |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 // Keys of the settings that are currently being synced. Only used to decide | 115 // Keys of the settings that are currently being synced. Only used to decide |
110 // whether an ACTION_ADD or ACTION_UPDATE should be sent to sync on a Set(). | 116 // whether an ACTION_ADD or ACTION_UPDATE should be sent to sync on a Set(). |
111 std::set<std::string> synced_keys_; | 117 std::set<std::string> synced_keys_; |
112 | 118 |
113 DISALLOW_COPY_AND_ASSIGN(SyncableSettingsStorage); | 119 DISALLOW_COPY_AND_ASSIGN(SyncableSettingsStorage); |
114 }; | 120 }; |
115 | 121 |
116 } // namespace extensions | 122 } // namespace extensions |
117 | 123 |
118 #endif // CHROME_BROWSER_EXTENSIONS_SETTINGS_SYNCABLE_SETTINGS_STORAGE_H_ | 124 #endif // CHROME_BROWSER_EXTENSIONS_SETTINGS_SYNCABLE_SETTINGS_STORAGE_H_ |
OLD | NEW |