| 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 const std::string& key, |
| 40 const Value& value) OVERRIDE; |
| 41 virtual WriteResult Set( |
| 42 WriteOptions options, const DictionaryValue& values) OVERRIDE; |
| 39 virtual WriteResult Remove(const std::string& key) OVERRIDE; | 43 virtual WriteResult Remove(const std::string& key) OVERRIDE; |
| 40 virtual WriteResult Remove(const std::vector<std::string>& keys) OVERRIDE; | 44 virtual WriteResult Remove(const std::vector<std::string>& keys) OVERRIDE; |
| 41 virtual WriteResult Clear() OVERRIDE; | 45 virtual WriteResult Clear() OVERRIDE; |
| 42 | 46 |
| 43 // Sync-related methods, analogous to those on SyncableService (handled by | 47 // Sync-related methods, analogous to those on SyncableService (handled by |
| 44 // ExtensionSettings), but with looser guarantees about when the methods | 48 // ExtensionSettings), but with looser guarantees about when the methods |
| 45 // can be called. | 49 // can be called. |
| 46 | 50 |
| 47 // Must only be called if sync isn't already active; not idempotent since | 51 // Must only be called if sync isn't already active; not idempotent since |
| 48 // behaviour would be undefined given differerent values of |sync_state|. | 52 // behaviour would be undefined given differerent values of |sync_state|. |
| (...skipping 60 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 | 113 // 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(). | 114 // whether an ACTION_ADD or ACTION_UPDATE should be sent to sync on a Set(). |
| 111 std::set<std::string> synced_keys_; | 115 std::set<std::string> synced_keys_; |
| 112 | 116 |
| 113 DISALLOW_COPY_AND_ASSIGN(SyncableSettingsStorage); | 117 DISALLOW_COPY_AND_ASSIGN(SyncableSettingsStorage); |
| 114 }; | 118 }; |
| 115 | 119 |
| 116 } // namespace extensions | 120 } // namespace extensions |
| 117 | 121 |
| 118 #endif // CHROME_BROWSER_EXTENSIONS_SETTINGS_SYNCABLE_SETTINGS_STORAGE_H_ | 122 #endif // CHROME_BROWSER_EXTENSIONS_SETTINGS_SYNCABLE_SETTINGS_STORAGE_H_ |
| OLD | NEW |