Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(171)

Unified Diff: chrome/browser/prefs/pref_service.h

Issue 5915004: Introduce incognito preference settings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/prefs/pref_service.h
diff --git a/chrome/browser/prefs/pref_service.h b/chrome/browser/prefs/pref_service.h
index 2e0623bd0b8459b7f5fa5d5baad1b0aa8951bac7..927a4d91525cd1ee6e102c67ca29c5940d084170 100644
--- a/chrome/browser/prefs/pref_service.h
+++ b/chrome/browser/prefs/pref_service.h
@@ -42,7 +42,8 @@ class PrefService : public 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);
Mattias Nissler (ping if slow) 2010/12/22 12:09:03 Can't we just ask the PrefService of the type?
battre 2010/12/22 18:34:53 Will leave this in the Preference as discussed off
~Preference() {}
// Returns the name of the Preference (i.e., the key, e.g.,
@@ -92,6 +93,8 @@ class PrefService : public 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 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
@@ -231,7 +240,9 @@ class PrefService : public NonThreadSafe {
PrefStore* command_line_prefs,
PersistentPrefStore* user_prefs,
PrefStore* recommended_prefs,
- Profile* profile);
+ DefaultPrefStore* default_store,
+ Profile* profile,
+ bool init_from_storage);
// The PrefNotifier handles registering and notifying preference observers.
// It is created and owned by this PrefService. Subclasses may access it for
@@ -273,14 +284,20 @@ class PrefService : public 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_;
-
- // A set of all the registered Preference objects.
- PreferenceSet prefs_;
+ // Pref Stores and profile that we passed to the PrefValueStore.
+ scoped_refptr<PrefStore> managed_platform_prefs_;
+ scoped_refptr<PrefStore> device_management_prefs_;
+ scoped_refptr<PrefStore> extension_prefs_;
+ scoped_refptr<PrefStore> command_line_prefs_;
+ scoped_refptr<PrefStore> recommended_prefs_;
+ scoped_refptr<PersistentPrefStore> user_pref_store_;
+ scoped_refptr<DefaultPrefStore> default_store_;
+ Profile* profile_;
+
+ // 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);
};

Powered by Google App Engine
This is Rietveld 408576698