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