blob: 162033c924a1564f4077689e5b9334746b4a0b1a [file] [log] [blame]
[email protected]489db0842014-01-22 18:20:031// Copyright 2014 The Chromium Authors. All rights reserved.
[email protected]f2d1f612010-12-09 15:10:172// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
[email protected]489db0842014-01-22 18:20:035#ifndef EXTENSIONS_BROWSER_EXTENSION_PREF_STORE_H_
6#define EXTENSIONS_BROWSER_EXTENSION_PREF_STORE_H_
[email protected]f2d1f612010-12-09 15:10:177
[email protected]9a8c4022011-01-25 14:25:338#include <string>
9
[email protected]03b9b4e2012-10-22 20:01:5210#include "base/prefs/value_map_pref_store.h"
[email protected]489db0842014-01-22 18:20:0311#include "extensions/browser/extension_pref_value_map.h"
[email protected]f2d1f612010-12-09 15:10:1712
[email protected]9a8c4022011-01-25 14:25:3313// A (non-persistent) PrefStore implementation that holds effective preferences
14// set by extensions. These preferences are managed by and fetched from an
15// ExtensionPrefValueMap.
16class ExtensionPrefStore : public ValueMapPrefStore,
17 public ExtensionPrefValueMap::Observer {
[email protected]f2d1f612010-12-09 15:10:1718 public:
[email protected]9a8c4022011-01-25 14:25:3319 // Constructs an ExtensionPrefStore for a regular or an incognito profile.
[email protected]e7e38032011-07-26 17:25:2520 ExtensionPrefStore(ExtensionPrefValueMap* extension_pref_value_map,
21 bool incognito_pref_store);
[email protected]f2d1f612010-12-09 15:10:1722
[email protected]9a8c4022011-01-25 14:25:3323 // Overrides for ExtensionPrefValueMap::Observer:
dcheng9168b2f2014-10-21 12:38:2424 void OnInitializationCompleted() override;
25 void OnPrefValueChanged(const std::string& key) override;
26 void OnExtensionPrefValueMapDestruction() override;
[email protected]f2d1f612010-12-09 15:10:1727
[email protected]5f2a4752012-04-27 22:18:5828 protected:
dcheng9168b2f2014-10-21 12:38:2429 ~ExtensionPrefStore() override;
[email protected]5f2a4752012-04-27 22:18:5830
31 private:
[email protected]9a8c4022011-01-25 14:25:3332 ExtensionPrefValueMap* extension_pref_value_map_; // Weak pointer.
33 bool incognito_pref_store_;
[email protected]f2d1f612010-12-09 15:10:1734
35 DISALLOW_COPY_AND_ASSIGN(ExtensionPrefStore);
36};
37
[email protected]489db0842014-01-22 18:20:0338#endif // EXTENSIONS_BROWSER_EXTENSION_PREF_STORE_H_