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

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

Issue 11316163: Remove the last usages of PrefObserver outside of Prefs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review comments. Created 8 years 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/mock_pref_change_callback.cc
diff --git a/chrome/browser/prefs/mock_pref_change_callback.cc b/chrome/browser/prefs/mock_pref_change_callback.cc
new file mode 100644
index 0000000000000000000000000000000000000000..3dbd2a0483daea2f2fb9bc9789263be4fa5a2ce2
--- /dev/null
+++ b/chrome/browser/prefs/mock_pref_change_callback.cc
@@ -0,0 +1,25 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/prefs/mock_pref_change_callback.h"
+
+#include "base/bind.h"
+#include "chrome/common/chrome_notification_types.h"
+
+MockPrefChangeCallback::MockPrefChangeCallback(PrefServiceBase* prefs)
+ : prefs_(prefs) {
+}
+
+MockPrefChangeCallback::~MockPrefChangeCallback() {}
+
+PrefChangeRegistrar::NamedChangeCallback MockPrefChangeCallback::GetCallback() {
+ return base::Bind(&MockPrefChangeCallback::OnPreferenceChanged,
+ base::Unretained(this));
+}
+
+void MockPrefChangeCallback::Expect(const std::string& pref_name,
+ const Value* value) {
+ EXPECT_CALL(*this, OnPreferenceChanged(pref_name))
+ .With(PrefValueMatches(prefs_, pref_name, value));
+}
« no previous file with comments | « chrome/browser/prefs/mock_pref_change_callback.h ('k') | chrome/browser/prefs/pref_notifier_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698