| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/chrome_extensions_api_client.h" | 5 #include "chrome/browser/extensions/api/chrome_extensions_api_client.h" |
| 6 | 6 |
| 7 #include "chrome/browser/extensions/api/storage/sync_value_store_cache.h" |
| 8 #include "content/public/browser/browser_context.h" |
| 9 |
| 7 #if defined(ENABLE_CONFIGURATION_POLICY) | 10 #if defined(ENABLE_CONFIGURATION_POLICY) |
| 8 #include "chrome/browser/extensions/api/storage/managed_value_store_cache.h" | 11 #include "chrome/browser/extensions/api/storage/managed_value_store_cache.h" |
| 9 #endif | 12 #endif |
| 10 | 13 |
| 11 namespace extensions { | 14 namespace extensions { |
| 12 | 15 |
| 13 ChromeExtensionsAPIClient::ChromeExtensionsAPIClient() {} | 16 ChromeExtensionsAPIClient::ChromeExtensionsAPIClient() {} |
| 14 | 17 |
| 15 ChromeExtensionsAPIClient::~ChromeExtensionsAPIClient() {} | 18 ChromeExtensionsAPIClient::~ChromeExtensionsAPIClient() {} |
| 16 | 19 |
| 17 void ChromeExtensionsAPIClient::AddAdditionalValueStoreCaches( | 20 void ChromeExtensionsAPIClient::AddAdditionalValueStoreCaches( |
| 18 content::BrowserContext* context, | 21 content::BrowserContext* context, |
| 19 const scoped_refptr<SettingsStorageFactory>& factory, | 22 const scoped_refptr<SettingsStorageFactory>& factory, |
| 20 const scoped_refptr<ObserverListThreadSafe<SettingsObserver> >& observers, | 23 const scoped_refptr<ObserverListThreadSafe<SettingsObserver> >& observers, |
| 21 std::map<settings_namespace::Namespace, ValueStoreCache*>* caches) { | 24 std::map<settings_namespace::Namespace, ValueStoreCache*>* caches) { |
| 25 // Add support for chrome.storage.sync. |
| 26 (*caches)[settings_namespace::SYNC] = |
| 27 new SyncValueStoreCache(factory, observers, context->GetPath()); |
| 28 |
| 22 #if defined(ENABLE_CONFIGURATION_POLICY) | 29 #if defined(ENABLE_CONFIGURATION_POLICY) |
| 23 // Add support for chrome.storage.managed. | 30 // Add support for chrome.storage.managed. |
| 24 (*caches)[settings_namespace::MANAGED] = | 31 (*caches)[settings_namespace::MANAGED] = |
| 25 new ManagedValueStoreCache(context, factory, observers); | 32 new ManagedValueStoreCache(context, factory, observers); |
| 26 #endif | 33 #endif |
| 27 } | 34 } |
| 28 | 35 |
| 29 } // namespace extensions | 36 } // namespace extensions |
| OLD | NEW |