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

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

Issue 5174006: Move DeviceManagementPolicyProvider into the profile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address feedback. Created 10 years, 1 month 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_value_store.h
diff --git a/chrome/browser/prefs/pref_value_store.h b/chrome/browser/prefs/pref_value_store.h
index 87ed7b26b635cbfb6517d0b6d316a3d22c395e49..0e741c7701c6de28bf0e4bc71e12b4d5697135c9 100644
--- a/chrome/browser/prefs/pref_value_store.h
+++ b/chrome/browser/prefs/pref_value_store.h
@@ -172,7 +172,7 @@ class PrefValueStore : public base::RefCountedThreadSafe<PrefValueStore> {
// that conflict with proxy settings specified by proxy policy.
bool HasPolicyConflictingUserProxySettings();
- protected:
+ protected:
// In decreasing order of precedence:
// |managed_platform_prefs| contains all managed platform (non-cloud policy)
// preference values.
@@ -186,6 +186,14 @@ class PrefValueStore : public base::RefCountedThreadSafe<PrefValueStore> {
// |default_prefs| contains application-default preference values. It must
// be non-null if any preferences are to be registered.
//
+ // The |profile| parameter is used to construct a replacement device
+ // management pref store in case of policy refresh, may be NULL for the local
+ // state preferences.
markusheintz_ 2010/11/18 15:42:33 I'm so sorry to bother you with comments, but I do
Mattias Nissler (ping if slow) 2010/11/18 16:06:38 Na, the comment is really about this: The device m
markusheintz_ 2010/11/19 09:53:08 That's how I understood it too. But I had to read
+ //
+ // TODO(mnissler, danno): Refactor the pref store interface and refresh logic
+ // so refreshes can be handled by the pref store itself and the profile
+ // parameter be removed here.
+ //
// This constructor should only be used internally, or by subclasses in
// testing. The usual way to create a PrefValueStore is by creating a
// PrefService.
@@ -195,19 +203,16 @@ class PrefValueStore : public base::RefCountedThreadSafe<PrefValueStore> {
PrefStore* command_line_prefs,
PrefStore* user_prefs,
PrefStore* recommended_prefs,
- PrefStore* default_prefs);
+ PrefStore* default_prefs,
+ Profile* profile);
private:
+ typedef std::map<std::string, Value::ValueType> PrefTypeMap;
+
friend class PrefValueStoreTest;
FRIEND_TEST_ALL_PREFIXES(PrefValueStoreTest,
TestRefreshPolicyPrefsCompletion);
- scoped_ptr<PrefStore> pref_stores_[PrefNotifier::PREF_STORE_TYPE_MAX + 1];
-
- // A mapping of preference names to their registered types.
- typedef std::map<std::string, Value::ValueType> PrefTypeMap;
- PrefTypeMap pref_types_;
-
// Returns true if the preference with the given name has a value in the
// given PrefStoreType, of the same value type as the preference was
// registered with.
@@ -237,6 +242,14 @@ class PrefValueStore : public base::RefCountedThreadSafe<PrefValueStore> {
PrefStore* new_recommended_pref_store,
AfterRefreshCallback* callback);
+ scoped_ptr<PrefStore> pref_stores_[PrefNotifier::PREF_STORE_TYPE_MAX + 1];
+
+ // A mapping of preference names to their registered types.
+ PrefTypeMap pref_types_;
+
+ // The associated profile, if applicable.
markusheintz_ 2010/11/18 15:42:33 When is it not applicable? Maybe it's worth to add
Mattias Nissler (ping if slow) 2010/11/18 16:06:38 It's only applicable if this pref_value_store is a
markusheintz_ 2010/11/19 09:53:08 I understood this comment, but I think if someone
+ Profile* profile_;
+
DISALLOW_COPY_AND_ASSIGN(PrefValueStore);
};

Powered by Google App Engine
This is Rietveld 408576698