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_API_STORAGE_SETTINGS_SYNC_PROCESSOR_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_STORAGE_SETTINGS_SYNC_PROCESSOR_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_API_STORAGE_SETTINGS_SYNC_PROCESSOR_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_STORAGE_SETTINGS_SYNC_PROCESSOR_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 13 matching lines...) Expand all Loading... |
24 // settings. | 24 // settings. |
25 // - rate limiting (inherently per-extension, which is what we want). | 25 // - rate limiting (inherently per-extension, which is what we want). |
26 class SettingsSyncProcessor { | 26 class SettingsSyncProcessor { |
27 public: | 27 public: |
28 SettingsSyncProcessor(const std::string& extension_id, | 28 SettingsSyncProcessor(const std::string& extension_id, |
29 syncer::ModelType type, | 29 syncer::ModelType type, |
30 syncer::SyncChangeProcessor* sync_processor); | 30 syncer::SyncChangeProcessor* sync_processor); |
31 ~SettingsSyncProcessor(); | 31 ~SettingsSyncProcessor(); |
32 | 32 |
33 // Initializes this with the initial state of sync. | 33 // Initializes this with the initial state of sync. |
34 void Init(const DictionaryValue& initial_state); | 34 void Init(const base::DictionaryValue& initial_state); |
35 | 35 |
36 // Sends |changes| to sync. | 36 // Sends |changes| to sync. |
37 syncer::SyncError SendChanges(const ValueStoreChangeList& changes); | 37 syncer::SyncError SendChanges(const ValueStoreChangeList& changes); |
38 | 38 |
39 // Informs this that |changes| have been receieved from sync. No action will | 39 // Informs this that |changes| have been receieved from sync. No action will |
40 // be taken, but this must be notified for internal bookkeeping. | 40 // be taken, but this must be notified for internal bookkeeping. |
41 void NotifyChanges(const ValueStoreChangeList& changes); | 41 void NotifyChanges(const ValueStoreChangeList& changes); |
42 | 42 |
43 syncer::ModelType type() { return type_; } | 43 syncer::ModelType type() { return type_; } |
44 | 44 |
(...skipping 13 matching lines...) Expand all Loading... |
58 // Keys of the settings that are currently being synced. Used to decide what | 58 // Keys of the settings that are currently being synced. Used to decide what |
59 // kind of action (ADD, UPDATE, REMOVE) to send to sync. | 59 // kind of action (ADD, UPDATE, REMOVE) to send to sync. |
60 std::set<std::string> synced_keys_; | 60 std::set<std::string> synced_keys_; |
61 | 61 |
62 DISALLOW_COPY_AND_ASSIGN(SettingsSyncProcessor); | 62 DISALLOW_COPY_AND_ASSIGN(SettingsSyncProcessor); |
63 }; | 63 }; |
64 | 64 |
65 } // namespace extensions | 65 } // namespace extensions |
66 | 66 |
67 #endif // CHROME_BROWSER_EXTENSIONS_API_STORAGE_SETTINGS_SYNC_PROCESSOR_H_ | 67 #endif // CHROME_BROWSER_EXTENSIONS_API_STORAGE_SETTINGS_SYNC_PROCESSOR_H_ |
OLD | NEW |