diff options
-rw-r--r-- | chrome/browser/pref_service.cc | 24 | ||||
-rw-r--r-- | chrome/browser/pref_service.h | 4 |
2 files changed, 28 insertions, 0 deletions
diff --git a/chrome/browser/pref_service.cc b/chrome/browser/pref_service.cc index 62f8340..2a608fb 100644 --- a/chrome/browser/pref_service.cc +++ b/chrome/browser/pref_service.cc @@ -458,6 +458,10 @@ void PrefService::SetBoolean(const wchar_t* path, bool value) { NOTREACHED() << "Trying to write an unregistered pref: " << path; return; } + if (pref->IsManaged()) { + NOTREACHED() << "Preference is managed: " << path; + return; + } if (pref->type() != Value::TYPE_BOOLEAN) { NOTREACHED() << "Wrong type for SetBoolean: " << path; return; @@ -477,6 +481,10 @@ void PrefService::SetInteger(const wchar_t* path, int value) { NOTREACHED() << "Trying to write an unregistered pref: " << path; return; } + if (pref->IsManaged()) { + NOTREACHED() << "Preference is managed: " << path; + return; + } if (pref->type() != Value::TYPE_INTEGER) { NOTREACHED() << "Wrong type for SetInteger: " << path; return; @@ -496,6 +504,10 @@ void PrefService::SetReal(const wchar_t* path, double value) { NOTREACHED() << "Trying to write an unregistered pref: " << path; return; } + if (pref->IsManaged()) { + NOTREACHED() << "Preference is managed: " << path; + return; + } if (pref->type() != Value::TYPE_REAL) { NOTREACHED() << "Wrong type for SetReal: " << path; return; @@ -515,6 +527,10 @@ void PrefService::SetString(const wchar_t* path, const std::wstring& value) { NOTREACHED() << "Trying to write an unregistered pref: " << path; return; } + if (pref->IsManaged()) { + NOTREACHED() << "Preference is managed: " << path; + return; + } if (pref->type() != Value::TYPE_STRING) { NOTREACHED() << "Wrong type for SetString: " << path; return; @@ -534,6 +550,10 @@ void PrefService::SetFilePath(const wchar_t* path, const FilePath& value) { NOTREACHED() << "Trying to write an unregistered pref: " << path; return; } + if (pref->IsManaged()) { + NOTREACHED() << "Preference is managed: " << path; + return; + } if (pref->type() != Value::TYPE_STRING) { NOTREACHED() << "Wrong type for SetFilePath: " << path; return; @@ -560,6 +580,10 @@ void PrefService::SetInt64(const wchar_t* path, int64 value) { NOTREACHED() << "Trying to write an unregistered pref: " << path; return; } + if (pref->IsManaged()) { + NOTREACHED() << "Preference is managed: " << path; + return; + } if (pref->type() != Value::TYPE_STRING) { NOTREACHED() << "Wrong type for SetInt64: " << path; return; diff --git a/chrome/browser/pref_service.h b/chrome/browser/pref_service.h index 5b18d9d..584063f 100644 --- a/chrome/browser/pref_service.h +++ b/chrome/browser/pref_service.h @@ -51,6 +51,10 @@ class PrefService : public NonThreadSafe { // Returns true if the current value matches the default value. bool IsDefaultValue() const; + // Returns true if the Preference is managed, i.e. not changeable + // by the user. + bool IsManaged() const { return false; } + private: friend class PrefService; |