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

Unified Diff: chrome/browser/content_settings/content_settings_pref_provider_unittest.cc

Issue 11293249: Remove PrefObserver usage, batch 3. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to LKGR Created 8 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/content_settings/content_settings_pref_provider_unittest.cc
diff --git a/chrome/browser/content_settings/content_settings_pref_provider_unittest.cc b/chrome/browser/content_settings/content_settings_pref_provider_unittest.cc
index c61b4a523cd2d13ff4a81546e88903a643079f10..0a5638161ba73a3d9a77dd04ac168f7065544daf 100644
--- a/chrome/browser/content_settings/content_settings_pref_provider_unittest.cc
+++ b/chrome/browser/content_settings/content_settings_pref_provider_unittest.cc
@@ -11,7 +11,6 @@
#include "base/prefs/default_pref_store.h"
#include "base/prefs/overlay_user_pref_store.h"
#include "base/prefs/public/pref_change_registrar.h"
-#include "base/prefs/public/pref_observer.h"
#include "base/prefs/testing_pref_store.h"
#include "base/threading/platform_thread.h"
#include "base/values.h"
@@ -53,7 +52,7 @@ class DeadlockCheckerThread : public base::PlatformThread::Delegate {
// A helper for observing an preference changes and testing whether
// |PrefProvider| holds a lock when the preferences change.
-class DeadlockCheckerObserver : public PrefObserver {
+class DeadlockCheckerObserver {
public:
// |DeadlockCheckerObserver| doesn't take the ownership of |prefs| or
// ||provider|.
@@ -61,12 +60,20 @@ class DeadlockCheckerObserver : public PrefObserver {
: provider_(provider),
notification_received_(false) {
pref_change_registrar_.Init(prefs);
- pref_change_registrar_.Add(prefs::kContentSettingsPatternPairs, this);
+ pref_change_registrar_.Add(
+ prefs::kContentSettingsPatternPairs,
+ base::Bind(
+ &DeadlockCheckerObserver::OnContentSettingsPatternPairsChanged,
+ base::Unretained(this)));
}
virtual ~DeadlockCheckerObserver() {}
- virtual void OnPreferenceChanged(PrefServiceBase* service,
- const std::string& pref_name) {
+ bool notification_received() const {
+ return notification_received_;
+ }
+
+ private:
+ void OnContentSettingsPatternPairsChanged() {
// Check whether |provider_| holds its lock. For this, we need a
// separate thread.
DeadlockCheckerThread thread(provider_);
@@ -76,11 +83,6 @@ class DeadlockCheckerObserver : public PrefObserver {
notification_received_ = true;
}
- bool notification_received() const {
- return notification_received_;
- }
-
- private:
PrefProvider* provider_;
PrefChangeRegistrar pref_change_registrar_;
bool notification_received_;
« no previous file with comments | « chrome/browser/content_settings/content_settings_pref_provider.cc ('k') | chrome/browser/content_settings/cookie_settings.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698