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 #include "chrome/browser/extensions/api/storage/settings_sync_util.h" | 5 #include "chrome/browser/extensions/api/storage/settings_sync_util.h" |
6 | 6 |
7 #include "base/json/json_writer.h" | 7 #include "base/json/json_writer.h" |
8 #include "base/values.h" | 8 #include "base/values.h" |
9 #include "chrome/browser/extensions/api/storage/sync_value_store_cache.h" | 9 #include "chrome/browser/extensions/api/storage/sync_value_store_cache.h" |
10 #include "content/public/browser/browser_thread.h" | 10 #include "content/public/browser/browser_thread.h" |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 syncer::ModelType type) { | 105 syncer::ModelType type) { |
106 base::DictionaryValue no_value; | 106 base::DictionaryValue no_value; |
107 return syncer::SyncChange( | 107 return syncer::SyncChange( |
108 FROM_HERE, | 108 FROM_HERE, |
109 syncer::SyncChange::ACTION_DELETE, | 109 syncer::SyncChange::ACTION_DELETE, |
110 CreateData(extension_id, key, no_value, type)); | 110 CreateData(extension_id, key, no_value, type)); |
111 } | 111 } |
112 | 112 |
113 syncer::SyncableService* GetSyncableService(content::BrowserContext* context, | 113 syncer::SyncableService* GetSyncableService(content::BrowserContext* context, |
114 syncer::ModelType type) { | 114 syncer::ModelType type) { |
115 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); | 115 DCHECK_CURRENTLY_ON(BrowserThread::FILE); |
116 DCHECK(type == syncer::APP_SETTINGS || type == syncer::EXTENSION_SETTINGS); | 116 DCHECK(type == syncer::APP_SETTINGS || type == syncer::EXTENSION_SETTINGS); |
117 StorageFrontend* frontend = StorageFrontend::Get(context); | 117 StorageFrontend* frontend = StorageFrontend::Get(context); |
118 SyncValueStoreCache* sync_cache = static_cast<SyncValueStoreCache*>( | 118 SyncValueStoreCache* sync_cache = static_cast<SyncValueStoreCache*>( |
119 frontend->GetValueStoreCache(settings_namespace::SYNC)); | 119 frontend->GetValueStoreCache(settings_namespace::SYNC)); |
120 return sync_cache->GetSyncableService(type); | 120 return sync_cache->GetSyncableService(type); |
121 } | 121 } |
122 | 122 |
123 } // namespace settings_sync_util | 123 } // namespace settings_sync_util |
124 | 124 |
125 } // namespace extensions | 125 } // namespace extensions |
OLD | NEW |