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

Unified Diff: chrome/browser/prefs/pref_notifier_impl.cc

Issue 8568019: Introduce per-tab preferences service. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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_notifier_impl.cc
diff --git a/chrome/browser/prefs/pref_notifier_impl.cc b/chrome/browser/prefs/pref_notifier_impl.cc
index ec5352bcae54d5b63881271e6887991feafb589e..a01c89f3e525088a32cbff24fb79380b7cd8f69a 100644
--- a/chrome/browser/prefs/pref_notifier_impl.cc
+++ b/chrome/browser/prefs/pref_notifier_impl.cc
@@ -5,13 +5,15 @@
#include "chrome/browser/prefs/pref_notifier_impl.h"
#include "base/stl_util.h"
+#include "chrome/browser/prefs/pref_model_associator.h"
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/common/chrome_notification_types.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_service.h"
-PrefNotifierImpl::PrefNotifierImpl(PrefService* service)
- : pref_service_(service) {
+PrefNotifierImpl::PrefNotifierImpl()
+ : pref_service_(NULL),
+ pref_model_associator_(NULL) {
}
PrefNotifierImpl::~PrefNotifierImpl() {
@@ -88,9 +90,12 @@ void PrefNotifierImpl::FireObservers(const std::string& path) {
DCHECK(CalledOnValidThread());
// Only send notifications for registered preferences.
- if (!pref_service_->FindPreference(path.c_str()))
+ if (!pref_service_ || !pref_service_->FindPreference(path.c_str()))
return;
+ if (pref_model_associator_)
+ pref_model_associator_->ProcessPrefChange(path);
Mattias Nissler (ping if slow) 2011/11/16 12:08:04 Seems like this now duplicates the same thing in P
mnaganov (inactive) 2011/11/17 16:50:58 Right. I haven't understood that from your change.
+
const PrefObserverMap::iterator observer_iterator =
pref_observers_.find(path);
if (observer_iterator == pref_observers_.end())
@@ -104,3 +109,14 @@ void PrefNotifierImpl::FireObservers(const std::string& path) {
content::Details<const std::string>(&path));
}
}
+
+void PrefNotifierImpl::SetPrefModelAssociator(
+ PrefModelAssociator* pref_model_associator) {
+ DCHECK(pref_model_associator_ == NULL);
+ pref_model_associator_ = pref_model_associator;
+}
+
+void PrefNotifierImpl::SetPrefService(PrefService* pref_service) {
+ DCHECK(pref_service_ == NULL);
+ pref_service_ = pref_service;
+}

Powered by Google App Engine
This is Rietveld 408576698