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_SETTINGS_SYNC_UTIL_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_SETTINGS_SETTINGS_SYNC_UTIL_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_SETTINGS_SETTINGS_SYNC_UTIL_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_SETTINGS_SETTINGS_SYNC_UTIL_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 | 9 |
10 #include "chrome/browser/sync/api/sync_data.h" | 10 #include "chrome/browser/sync/api/sync_data.h" |
11 #include "chrome/browser/sync/api/sync_change.h" | 11 #include "chrome/browser/sync/api/sync_change.h" |
12 | 12 |
13 namespace base { | 13 namespace base { |
14 class Value; | 14 class Value; |
15 } // namespace base | 15 } // namespace base |
16 | 16 |
17 namespace extensions { | 17 namespace extensions { |
18 | 18 |
19 namespace settings_sync_util { | 19 namespace settings_sync_util { |
20 | 20 |
21 // Creates a SyncData object for an extension setting. | 21 // Creates a SyncData object for an extension or app setting. |
22 SyncData CreateData( | 22 SyncData CreateData( |
23 const std::string& extension_id, | 23 const std::string& extension_id, |
24 const std::string& key, | 24 const std::string& key, |
25 const base::Value& value); | 25 const base::Value& value, |
| 26 syncable::ModelType type); |
26 | 27 |
27 // Creates an "add" sync change for an extension setting. | 28 // Creates an "add" sync change for an extension or app setting. |
28 SyncChange CreateAdd( | 29 SyncChange CreateAdd( |
29 const std::string& extension_id, | 30 const std::string& extension_id, |
30 const std::string& key, | 31 const std::string& key, |
31 const base::Value& value); | 32 const base::Value& value, |
| 33 syncable::ModelType type); |
32 | 34 |
33 // Creates an "update" sync change for an extension setting. | 35 // Creates an "update" sync change for an extension or app setting. |
34 SyncChange CreateUpdate( | 36 SyncChange CreateUpdate( |
35 const std::string& extension_id, | 37 const std::string& extension_id, |
36 const std::string& key, | 38 const std::string& key, |
37 const base::Value& value); | 39 const base::Value& value, |
| 40 syncable::ModelType type); |
38 | 41 |
39 // Creates a "delete" sync change for an extension setting. | 42 // Creates a "delete" sync change for an extension or app setting. |
40 SyncChange CreateDelete( | 43 SyncChange CreateDelete( |
41 const std::string& extension_id, const std::string& key); | 44 const std::string& extension_id, |
| 45 const std::string& key, |
| 46 syncable::ModelType type); |
42 | 47 |
43 } // namespace settings_sync_util | 48 } // namespace settings_sync_util |
44 | 49 |
45 } // namespace extensions | 50 } // namespace extensions |
46 | 51 |
47 #endif // CHROME_BROWSER_EXTENSIONS_SETTINGS_SETTINGS_SYNC_UTIL_H_ | 52 #endif // CHROME_BROWSER_EXTENSIONS_SETTINGS_SETTINGS_SYNC_UTIL_H_ |
OLD | NEW |