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_UTIL_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_STORAGE_SETTINGS_SYNC_UTIL_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_API_STORAGE_SETTINGS_SYNC_UTIL_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_STORAGE_SETTINGS_SYNC_UTIL_H_ |
7 | 7 |
| 8 #include <string> |
| 9 |
| 10 #include "components/sync/driver/sync_client.h" |
8 #include "components/sync/model/sync_change.h" | 11 #include "components/sync/model/sync_change.h" |
9 #include "components/sync/model/sync_data.h" | 12 #include "components/sync/model/sync_data.h" |
10 | 13 |
11 namespace base { | 14 namespace base { |
12 class Value; | 15 class Value; |
13 } | 16 } |
14 | 17 |
15 namespace content { | 18 namespace content { |
16 class BrowserContext; | 19 class BrowserContext; |
17 } | 20 } |
18 | 21 |
19 namespace syncer { | |
20 class SyncableService; | |
21 } | |
22 | |
23 namespace extensions { | 22 namespace extensions { |
24 | 23 |
25 namespace settings_sync_util { | 24 namespace settings_sync_util { |
26 | 25 |
27 // Creates a syncer::SyncData object for an extension or app setting. | 26 // Creates a syncer::SyncData object for an extension or app setting. |
28 syncer::SyncData CreateData( | 27 syncer::SyncData CreateData( |
29 const std::string& extension_id, | 28 const std::string& extension_id, |
30 const std::string& key, | 29 const std::string& key, |
31 const base::Value& value, | 30 const base::Value& value, |
32 syncer::ModelType type); | 31 syncer::ModelType type); |
(...skipping 13 matching lines...) Expand all Loading... |
46 syncer::ModelType type); | 45 syncer::ModelType type); |
47 | 46 |
48 // Creates a "delete" sync change for an extension or app setting. | 47 // Creates a "delete" sync change for an extension or app setting. |
49 syncer::SyncChange CreateDelete( | 48 syncer::SyncChange CreateDelete( |
50 const std::string& extension_id, | 49 const std::string& extension_id, |
51 const std::string& key, | 50 const std::string& key, |
52 syncer::ModelType type); | 51 syncer::ModelType type); |
53 | 52 |
54 // Returns the sync service for settings. Must be called on the FILE thread. | 53 // Returns the sync service for settings. Must be called on the FILE thread. |
55 // |type| must be either APP_SETTINGS or EXTENSION_SETTINGS. | 54 // |type| must be either APP_SETTINGS or EXTENSION_SETTINGS. |
56 syncer::SyncableService* GetSyncableService(content::BrowserContext* context, | 55 syncer::SyncClient::ServiceProvider GetSyncableServiceProvider( |
57 syncer::ModelType type); | 56 content::BrowserContext* context, |
| 57 syncer::ModelType type); |
58 | 58 |
59 } // namespace settings_sync_util | 59 } // namespace settings_sync_util |
60 | 60 |
61 } // namespace extensions | 61 } // namespace extensions |
62 | 62 |
63 #endif // CHROME_BROWSER_EXTENSIONS_API_STORAGE_SETTINGS_SYNC_UTIL_H_ | 63 #endif // CHROME_BROWSER_EXTENSIONS_API_STORAGE_SETTINGS_SYNC_UTIL_H_ |
OLD | NEW |