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

Unified Diff: chrome/browser/pref_service.cc

Issue 3051001: Adjust preference sync code to only sync user modifiable preferences. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: separate out the download_manager_unittest.cc fixes Created 10 years, 5 months 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
« no previous file with comments | « chrome/browser/pref_service.h ('k') | chrome/browser/pref_service_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/pref_service.cc
diff --git a/chrome/browser/pref_service.cc b/chrome/browser/pref_service.cc
index 9db99bc6cb2993674e2622dba2c68ed9e69784d8..f44152088cb1ae4edd3fcee372660d8f1d43a460 100644
--- a/chrome/browser/pref_service.cc
+++ b/chrome/browser/pref_service.cc
@@ -421,6 +421,25 @@ void PrefService::FireObserversIfChanged(const wchar_t* path,
FireObservers(path);
}
+void PrefService::FireObservers(const wchar_t* path) {
+ DCHECK(CalledOnValidThread());
+
+ // Convert path to a std::wstring because the Details constructor requires a
+ // class.
+ std::wstring path_str(path);
+ PrefObserverMap::iterator observer_iterator = pref_observers_.find(path_str);
+ if (observer_iterator == pref_observers_.end())
+ return;
+
+ NotificationObserverList::Iterator it(*(observer_iterator->second));
+ NotificationObserver* observer;
+ while ((observer = it.GetNext()) != NULL) {
+ observer->Observe(NotificationType::PREF_CHANGED,
+ Source<PrefService>(this),
+ Details<std::wstring>(&path_str));
+ }
+}
+
bool PrefService::PrefIsChanged(const wchar_t* path,
const Value* old_value) {
Value* new_value = NULL;
@@ -791,25 +810,6 @@ Value* PrefService::GetPrefCopy(const wchar_t* path) {
return pref->GetValue()->DeepCopy();
}
-void PrefService::FireObservers(const wchar_t* path) {
- DCHECK(CalledOnValidThread());
-
- // Convert path to a std::wstring because the Details constructor requires a
- // class.
- std::wstring path_str(path);
- PrefObserverMap::iterator observer_iterator = pref_observers_.find(path_str);
- if (observer_iterator == pref_observers_.end())
- return;
-
- NotificationObserverList::Iterator it(*(observer_iterator->second));
- NotificationObserver* observer;
- while ((observer = it.GetNext()) != NULL) {
- observer->Observe(NotificationType::PREF_CHANGED,
- Source<PrefService>(this),
- Details<std::wstring>(&path_str));
- }
-}
-
///////////////////////////////////////////////////////////////////////////////
// PrefService::Preference
@@ -872,3 +872,7 @@ bool PrefService::Preference::IsExtensionControlled() const {
bool PrefService::Preference::IsUserControlled() const {
return pref_value_store_->PrefValueFromUserStore(name_.c_str());
}
+
+bool PrefService::Preference::IsUserModifiable() const {
+ return pref_value_store_->PrefValueUserModifiable(name_.c_str());
+}
« no previous file with comments | « chrome/browser/pref_service.h ('k') | chrome/browser/pref_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698