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
3 // found in the LICENSE file.
5 #include "chrome/browser/extensions/api/chrome_extensions_api_client.h"
7 #include "base/files/file_path.h"
8 #include "chrome/browser/extensions/api/storage/sync_value_store_cache.h"
9 #include "content/public/browser/browser_context.h"
11 #if defined(ENABLE_CONFIGURATION_POLICY)
12 #include "chrome/browser/extensions/api/storage/managed_value_store_cache.h"
15 namespace extensions
{
17 ChromeExtensionsAPIClient::ChromeExtensionsAPIClient() {}
19 ChromeExtensionsAPIClient::~ChromeExtensionsAPIClient() {}
21 void ChromeExtensionsAPIClient::AddAdditionalValueStoreCaches(
22 content::BrowserContext
* context
,
23 const scoped_refptr
<SettingsStorageFactory
>& factory
,
24 const scoped_refptr
<ObserverListThreadSafe
<SettingsObserver
> >& observers
,
25 std::map
<settings_namespace::Namespace
, ValueStoreCache
*>* caches
) {
26 // Add support for chrome.storage.sync.
27 (*caches
)[settings_namespace::SYNC
] =
28 new SyncValueStoreCache(factory
, observers
, context
->GetPath());
30 #if defined(ENABLE_CONFIGURATION_POLICY)
31 // Add support for chrome.storage.managed.
32 (*caches
)[settings_namespace::MANAGED
] =
33 new ManagedValueStoreCache(context
, factory
, observers
);
37 } // namespace extensions