// Copyright 2016 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. #ifndef EXTENSIONS_BROWSER_VALUE_STORE_VALUE_STORE_FACTORY_IMPL_H_ #define EXTENSIONS_BROWSER_VALUE_STORE_VALUE_STORE_FACTORY_IMPL_H_ #include #include #include "base/files/file_path.h" #include "base/memory/ref_counted.h" #include "base/memory/scoped_ptr.h" #include "extensions/browser/value_store/value_store.h" #include "extensions/browser/value_store/value_store_factory.h" #include "extensions/common/extension.h" namespace extensions { class LegacyValueStoreFactory; // Mint new |ValueStore| instances for use by the extensions system. These are // used for extension rules, state, and settings. class ValueStoreFactoryImpl : public ValueStoreFactory { public: explicit ValueStoreFactoryImpl(const base::FilePath& profile_path); // ValueStoreFactory scoped_ptr CreateRulesStore() override; scoped_ptr CreateStateStore() override; scoped_ptr CreateSettingsStore( settings_namespace::Namespace settings_namespace, ModelType model_type, const ExtensionId& extension_id) override; void DeleteSettings(settings_namespace::Namespace settings_namespace, ModelType model_type, const ExtensionId& extension_id) override; bool HasSettings(settings_namespace::Namespace settings_namespace, ModelType model_type, const ExtensionId& extension_id) override; std::set GetKnownExtensionIDs( settings_namespace::Namespace settings_namespace, ModelType model_type) const override; private: // ValueStoreFactory is refcounted. ~ValueStoreFactoryImpl() override; scoped_refptr legacy_factory_; DISALLOW_COPY_AND_ASSIGN(ValueStoreFactoryImpl); }; } // namespace extensions #endif // EXTENSIONS_BROWSER_VALUE_STORE_VALUE_STORE_FACTORY_IMPL_H_