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

Unified Diff: chrome/test/base/testing_pref_service.cc

Issue 12079097: Introduce PrefRegistrySyncable, simplifying PrefServiceSyncable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to head again; base::File changes conflicted. Created 7 years, 10 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/test/base/testing_pref_service.h ('k') | chrome/test/base/testing_profile.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/base/testing_pref_service.cc
diff --git a/chrome/test/base/testing_pref_service.cc b/chrome/test/base/testing_pref_service.cc
index a6801dda88d8e6963b2fa335bd67270bc8593881..3aabc0c1a6d773077cee9d09788bb56908acba6d 100644
--- a/chrome/test/base/testing_pref_service.cc
+++ b/chrome/test/base/testing_pref_service.cc
@@ -10,6 +10,7 @@
#include "chrome/browser/prefs/browser_prefs.h"
#include "chrome/browser/prefs/pref_notifier_impl.h"
#include "chrome/browser/prefs/pref_registry_simple.h"
+#include "chrome/browser/prefs/pref_registry_syncable.h"
#include "chrome/browser/prefs/pref_value_store.h"
#include "chrome/test/base/testing_browser_process.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -64,7 +65,7 @@ TestingPrefServiceBase<PrefServiceSyncable>::TestingPrefServiceBase(
pref_registry->defaults(),
pref_notifier),
user_prefs,
- pref_registry,
+ static_cast<PrefRegistrySyncable*>(pref_registry),
base::Bind(&HandleReadError),
false),
managed_prefs_(managed_prefs),
@@ -88,24 +89,27 @@ PrefRegistrySimple* TestingPrefServiceSimple::registry() {
return static_cast<PrefRegistrySimple*>(DeprecatedGetPrefRegistry());
}
-// TODO(joi): Switch to PrefRegistrySyncable once available.
TestingPrefServiceSyncable::TestingPrefServiceSyncable()
: TestingPrefServiceBase<PrefServiceSyncable>(
new TestingPrefStore(),
new TestingPrefStore(),
new TestingPrefStore(),
- new PrefRegistrySimple(),
+ new PrefRegistrySyncable(),
new PrefNotifierImpl()) {
}
TestingPrefServiceSyncable::~TestingPrefServiceSyncable() {
}
+PrefRegistrySyncable* TestingPrefServiceSyncable::registry() {
+ return static_cast<PrefRegistrySyncable*>(DeprecatedGetPrefRegistry());
+}
+
ScopedTestingLocalState::ScopedTestingLocalState(
TestingBrowserProcess* browser_process)
: browser_process_(browser_process) {
- chrome::RegisterLocalState(static_cast<PrefRegistrySimple*>(
- local_state_.DeprecatedGetPrefRegistry()), &local_state_);
+ chrome::RegisterLocalState(&local_state_,
+ local_state_.registry());
EXPECT_FALSE(browser_process->local_state());
browser_process->SetLocalState(&local_state_);
}
« no previous file with comments | « chrome/test/base/testing_pref_service.h ('k') | chrome/test/base/testing_profile.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698