Chromium Code Reviews| Index: chrome/browser/prefs/pref_service.h |
| diff --git a/chrome/browser/prefs/pref_service.h b/chrome/browser/prefs/pref_service.h |
| index f17bbbd2cfd358fefd1fe9d6c8a831e4e2206ca7..82e583ba4ffa5e697067c8434448329f112cad53 100644 |
| --- a/chrome/browser/prefs/pref_service.h |
| +++ b/chrome/browser/prefs/pref_service.h |
| @@ -1,4 +1,4 @@ |
| -// Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| +// Copyright (c) 2011 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. |
| @@ -42,7 +42,8 @@ class PrefService : public base::NonThreadSafe { |
| // dictionary (a branch), or list. You shouldn't need to construct this on |
| // your own; use the PrefService::Register*Pref methods instead. |
| Preference(const PrefService* service, |
| - const char* name); |
| + const char* name, |
| + Value::ValueType type); |
| ~Preference() {} |
| // Returns the name of the Preference (i.e., the key, e.g., |
| @@ -92,6 +93,8 @@ class PrefService : public base::NonThreadSafe { |
| std::string name_; |
| + Value::ValueType type_; |
| + |
| // Reference to the PrefService in which this pref was created. |
| const PrefService* pref_service_; |
| @@ -109,6 +112,12 @@ class PrefService : public base::NonThreadSafe { |
| PrefStore* extension_pref_store, |
| Profile* profile); |
| + // Creates an incognito copy of the pref service that shares most pref stores |
| + // but uses a fresh non-persistent overlay for the user pref store and an |
| + // individual extension pref store (to cache the effective extension prefs for |
| + // incognito windows). |
| + PrefService* CreateIncognitoPrefService(PrefStore* incognito_extension_prefs); |
| + |
| virtual ~PrefService(); |
| // Reloads the data from file. This should only be called when the importer |
| @@ -230,7 +239,13 @@ class PrefService : public base::NonThreadSafe { |
| PrefStore* extension_prefs, |
| PrefStore* command_line_prefs, |
| PersistentPrefStore* user_prefs, |
| - PrefStore* recommended_prefs); |
| + PrefStore* recommended_prefs, |
| + DefaultPrefStore* default_store); |
| + |
| + // Construct an incognito version of the pref service. Use |
| + // CreateIncognitoPrefService() instead of calling this constructor directly. |
| + PrefService(const PrefService& original, |
| + PrefStore* incognito_extension_prefs); |
|
Mattias Nissler (ping if slow)
2011/01/21 08:53:08
can this be private?
battre
2011/01/24 17:47:18
Done.
|
| // The PrefNotifier handles registering and notifying preference observers. |
| // It is created and owned by this PrefService. Subclasses may access it for |
| @@ -272,14 +287,14 @@ class PrefService : public base::NonThreadSafe { |
| // and owned by this PrefService. Subclasses may access it for unit testing. |
| scoped_refptr<PrefValueStore> pref_value_store_; |
| - // The persistent pref store used for actual user data. |
| - PersistentPrefStore* user_pref_store_; |
| - |
| - // Points to the default pref store we passed to the PrefValueStore. |
| - DefaultPrefStore* default_store_; |
| + // Pref Stores and profile that we passed to the PrefValueStore. |
| + scoped_refptr<PersistentPrefStore> user_pref_store_; |
| + scoped_refptr<DefaultPrefStore> default_store_; |
| - // A set of all the registered Preference objects. |
| - PreferenceSet prefs_; |
| + // Local cache of registered Preference objects. The default_store_ |
| + // is authoritative with respect to what the types and default values |
| + // of registered preferences are. |
| + mutable PreferenceSet prefs_; |
| DISALLOW_COPY_AND_ASSIGN(PrefService); |
| }; |