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