Index: chrome/browser/extensions/api/storage/settings_sync_util.cc |
diff --git a/chrome/browser/extensions/api/storage/settings_sync_util.cc b/chrome/browser/extensions/api/storage/settings_sync_util.cc |
index b974aa3f619ed30642362b13f163d86e2edf8479..b7a598a5ecd2dfa548b7c3c6a3ad5ee2ee05dab5 100644 |
--- a/chrome/browser/extensions/api/storage/settings_sync_util.cc |
+++ b/chrome/browser/extensions/api/storage/settings_sync_util.cc |
@@ -6,6 +6,8 @@ |
#include "base/json/json_writer.h" |
#include "base/values.h" |
+#include "chrome/browser/extensions/api/storage/settings_frontend.h" |
+#include "chrome/browser/extensions/api/storage/sync_value_store_cache.h" |
#include "sync/protocol/app_setting_specifics.pb.h" |
#include "sync/protocol/extension_setting_specifics.pb.h" |
#include "sync/protocol/sync.pb.h" |
@@ -105,6 +107,15 @@ syncer::SyncChange CreateDelete( |
CreateData(extension_id, key, no_value, type)); |
} |
+syncer::SyncableService* GetSyncableService(content::BrowserContext* context, |
+ syncer::ModelType type) { |
Devlin
2014/03/05 19:02:55
There used to be a DCHECK(OnFileThread) here (back
James Cook
2014/03/05 23:14:28
Added back. (I was relying on the DCHECK in SyncV
|
+ DCHECK(type == syncer::APP_SETTINGS || type == syncer::EXTENSION_SETTINGS); |
+ SettingsFrontend* frontend = SettingsFrontend::Get(context); |
+ SyncValueStoreCache* sync_cache = static_cast<SyncValueStoreCache*>( |
+ frontend->GetValueStoreCache(settings_namespace::SYNC)); |
+ return sync_cache->GetSyncableService(type); |
+} |
+ |
} // namespace settings_sync_util |
} // namespace extensions |