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

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

Issue 5915004: Introduce incognito preference settings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Whitespaces + fixes for trybot Created 10 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/pref_service_mock_builder.cc
diff --git a/chrome/browser/prefs/pref_service_mock_builder.cc b/chrome/browser/prefs/pref_service_mock_builder.cc
index 3060948fea420acc5023dee64cdc4375b993ee46..4967d6085a352025b9954719254c41d869089694 100644
--- a/chrome/browser/prefs/pref_service_mock_builder.cc
+++ b/chrome/browser/prefs/pref_service_mock_builder.cc
@@ -17,90 +17,99 @@ PrefServiceMockBuilder::PrefServiceMockBuilder()
}
PrefServiceMockBuilder&
-PrefServiceMockBuilder::WithManagedPlatformPrefs(PrefStore* store) {
- managed_platform_prefs_.reset(store);
+PrefServiceMockBuilder::WithManagedPlatformPrefs(
+ scoped_refptr<PrefStore> store) {
+ managed_platform_prefs_ = store;
return *this;
}
PrefServiceMockBuilder&
-PrefServiceMockBuilder::WithDeviceManagementPrefs(PrefStore* store) {
- device_management_prefs_.reset(store);
+PrefServiceMockBuilder::WithDeviceManagementPrefs(
+ scoped_refptr<PrefStore> store) {
+ device_management_prefs_ = store;
return *this;
}
PrefServiceMockBuilder&
-PrefServiceMockBuilder::WithExtensionPrefs(PrefStore* store) {
- extension_prefs_.reset(store);
+PrefServiceMockBuilder::WithExtensionPrefs(scoped_refptr<PrefStore> store) {
+ extension_prefs_ = store;
return *this;
}
PrefServiceMockBuilder&
-PrefServiceMockBuilder::WithCommandLinePrefs(PrefStore* store) {
- command_line_prefs_.reset(store);
+PrefServiceMockBuilder::WithCommandLinePrefs(scoped_refptr<PrefStore> store) {
+ command_line_prefs_ = store;
return *this;
}
PrefServiceMockBuilder&
-PrefServiceMockBuilder::WithUserPrefs(PersistentPrefStore* store) {
- user_prefs_.reset(store);
+PrefServiceMockBuilder::WithUserPrefs(
+ scoped_refptr<PersistentPrefStore> store) {
+ user_prefs_ = store;
return *this;
}
PrefServiceMockBuilder&
-PrefServiceMockBuilder::WithRecommendedPrefs(PrefStore* store) {
- recommended_prefs_.reset(store);
+PrefServiceMockBuilder::WithRecommendedPrefs(scoped_refptr<PrefStore> store) {
+ recommended_prefs_ = store;
return *this;
}
PrefServiceMockBuilder&
PrefServiceMockBuilder::WithManagedPlatformProvider(
policy::ConfigurationPolicyProvider* provider) {
- managed_platform_prefs_.reset(
- new policy::ConfigurationPolicyPrefStore(provider));
+ managed_platform_prefs_ =
+ new policy::ConfigurationPolicyPrefStore(provider);
return *this;
}
PrefServiceMockBuilder&
PrefServiceMockBuilder::WithDeviceManagementProvider(
policy::ConfigurationPolicyProvider* provider) {
- device_management_prefs_.reset(
- new policy::ConfigurationPolicyPrefStore(provider));
+ device_management_prefs_ =
+ new policy::ConfigurationPolicyPrefStore(provider);
return *this;
}
PrefServiceMockBuilder&
PrefServiceMockBuilder::WithRecommendedProvider(
policy::ConfigurationPolicyProvider* provider) {
- recommended_prefs_.reset(
- new policy::ConfigurationPolicyPrefStore(provider));
+ recommended_prefs_ =
+ new policy::ConfigurationPolicyPrefStore(provider);
return *this;
}
PrefServiceMockBuilder&
PrefServiceMockBuilder::WithCommandLine(CommandLine* command_line) {
- command_line_prefs_.reset(new CommandLinePrefStore(command_line));
+ command_line_prefs_ = new CommandLinePrefStore(command_line);
return *this;
}
PrefServiceMockBuilder&
PrefServiceMockBuilder::WithUserFilePrefs(const FilePath& prefs_file) {
- user_prefs_.reset(
+ user_prefs_ =
new JsonPrefStore(prefs_file,
BrowserThread::GetMessageLoopProxyForThread(
- BrowserThread::FILE)));
+ BrowserThread::FILE));
return *this;
}
PrefService* PrefServiceMockBuilder::Create() {
PrefService* pref_service =
- new PrefService(managed_platform_prefs_.release(),
- device_management_prefs_.release(),
- extension_prefs_.release(),
- command_line_prefs_.release(),
- user_prefs_.release(),
- recommended_prefs_.release(),
+ new PrefService(managed_platform_prefs_.get(),
+ device_management_prefs_.get(),
+ extension_prefs_.get(),
+ command_line_prefs_.get(),
+ user_prefs_.get(),
+ recommended_prefs_.get(),
profile_);
- user_prefs_.reset(new TestingPrefStore);
+ managed_platform_prefs_ = NULL;
+ device_management_prefs_ = NULL;
+ extension_prefs_ = NULL;
+ command_line_prefs_ = NULL;
+ user_prefs_ = NULL;
+ recommended_prefs_ = NULL;
+ user_prefs_ = new TestingPrefStore;
profile_ = NULL;
return pref_service;

Powered by Google App Engine
This is Rietveld 408576698