blob: 5c1e541485a02da95fa07fc5c7d618230341d268 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/extensions/api/chrome_extensions_api_client.h"
#include "base/files/file_path.h"
#include "chrome/browser/extensions/api/storage/sync_value_store_cache.h"
#include "content/public/browser/browser_context.h"
#if defined(ENABLE_CONFIGURATION_POLICY)
#include "chrome/browser/extensions/api/storage/managed_value_store_cache.h"
#endif
namespace extensions {
ChromeExtensionsAPIClient::ChromeExtensionsAPIClient() {}
ChromeExtensionsAPIClient::~ChromeExtensionsAPIClient() {}
void ChromeExtensionsAPIClient::AddAdditionalValueStoreCaches(
content::BrowserContext* context,
const scoped_refptr<SettingsStorageFactory>& factory,
const scoped_refptr<ObserverListThreadSafe<SettingsObserver> >& observers,
std::map<settings_namespace::Namespace, ValueStoreCache*>* caches) {
// Add support for chrome.storage.sync.
(*caches)[settings_namespace::SYNC] =
new SyncValueStoreCache(factory, observers, context->GetPath());
#if defined(ENABLE_CONFIGURATION_POLICY)
// Add support for chrome.storage.managed.
(*caches)[settings_namespace::MANAGED] =
new ManagedValueStoreCache(context, factory, observers);
#endif
}
} // namespace extensions
|