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

Side by Side Diff: chrome/browser/prefs/pref_service_mock_builder.cc

Issue 7096013: Allow device policy code to be optionally included. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Make changes requested by torne. Created 9 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/policy/policy_stubs.cc ('k') | chrome/browser/prefs/pref_service_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/prefs/pref_service_mock_builder.h" 5 #include "chrome/browser/prefs/pref_service_mock_builder.h"
6 6
7 #include "chrome/browser/policy/configuration_policy_pref_store.h" 7 #include "chrome/browser/policy/configuration_policy_pref_store.h"
8 #include "chrome/browser/prefs/command_line_pref_store.h" 8 #include "chrome/browser/prefs/command_line_pref_store.h"
9 #include "chrome/browser/prefs/default_pref_store.h" 9 #include "chrome/browser/prefs/default_pref_store.h"
10 #include "chrome/browser/prefs/pref_service.h" 10 #include "chrome/browser/prefs/pref_service.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 56
57 PrefServiceMockBuilder& 57 PrefServiceMockBuilder&
58 PrefServiceMockBuilder::WithRecommendedCloudPrefs(PrefStore* store) { 58 PrefServiceMockBuilder::WithRecommendedCloudPrefs(PrefStore* store) {
59 recommended_cloud_prefs_ = store; 59 recommended_cloud_prefs_ = store;
60 return *this; 60 return *this;
61 } 61 }
62 62
63 PrefServiceMockBuilder& 63 PrefServiceMockBuilder&
64 PrefServiceMockBuilder::WithManagedPlatformProvider( 64 PrefServiceMockBuilder::WithManagedPlatformProvider(
65 policy::ConfigurationPolicyProvider* provider) { 65 policy::ConfigurationPolicyProvider* provider) {
66 managed_platform_prefs_ = new policy::ConfigurationPolicyPrefStore(provider); 66 managed_platform_prefs_ = policy::ConfigurationPolicyPrefStore::Create(
67 provider);
67 return *this; 68 return *this;
68 } 69 }
69 70
70 PrefServiceMockBuilder& 71 PrefServiceMockBuilder&
71 PrefServiceMockBuilder::WithManagedCloudProvider( 72 PrefServiceMockBuilder::WithManagedCloudProvider(
72 policy::ConfigurationPolicyProvider* provider) { 73 policy::ConfigurationPolicyProvider* provider) {
73 managed_cloud_prefs_ = new policy::ConfigurationPolicyPrefStore(provider); 74 managed_cloud_prefs_ = policy::ConfigurationPolicyPrefStore::Create(provider);
74 return *this; 75 return *this;
75 } 76 }
76 77
77 PrefServiceMockBuilder& 78 PrefServiceMockBuilder&
78 PrefServiceMockBuilder::WithRecommendedPlatformProvider( 79 PrefServiceMockBuilder::WithRecommendedPlatformProvider(
79 policy::ConfigurationPolicyProvider* provider) { 80 policy::ConfigurationPolicyProvider* provider) {
80 recommended_platform_prefs_ = 81 recommended_platform_prefs_ =
81 new policy::ConfigurationPolicyPrefStore(provider); 82 policy::ConfigurationPolicyPrefStore::Create(provider);
82 return *this; 83 return *this;
83 } 84 }
84 85
85 PrefServiceMockBuilder& 86 PrefServiceMockBuilder&
86 PrefServiceMockBuilder::WithRecommendedCloudProvider( 87 PrefServiceMockBuilder::WithRecommendedCloudProvider(
87 policy::ConfigurationPolicyProvider* provider) { 88 policy::ConfigurationPolicyProvider* provider) {
88 recommended_cloud_prefs_ = new policy::ConfigurationPolicyPrefStore(provider); 89 recommended_cloud_prefs_ = policy::ConfigurationPolicyPrefStore::Create(
90 provider);
89 return *this; 91 return *this;
90 } 92 }
91 93
92 PrefServiceMockBuilder& 94 PrefServiceMockBuilder&
93 PrefServiceMockBuilder::WithCommandLine(CommandLine* command_line) { 95 PrefServiceMockBuilder::WithCommandLine(CommandLine* command_line) {
94 command_line_prefs_ = new CommandLinePrefStore(command_line); 96 command_line_prefs_ = new CommandLinePrefStore(command_line);
95 return *this; 97 return *this;
96 } 98 }
97 99
98 PrefServiceMockBuilder& 100 PrefServiceMockBuilder&
(...skipping 19 matching lines...) Expand all
118 managed_platform_prefs_ = NULL; 120 managed_platform_prefs_ = NULL;
119 managed_cloud_prefs_ = NULL; 121 managed_cloud_prefs_ = NULL;
120 extension_prefs_ = NULL; 122 extension_prefs_ = NULL;
121 command_line_prefs_ = NULL; 123 command_line_prefs_ = NULL;
122 user_prefs_ = NULL; 124 user_prefs_ = NULL;
123 recommended_platform_prefs_ = NULL; 125 recommended_platform_prefs_ = NULL;
124 recommended_cloud_prefs_ = NULL; 126 recommended_cloud_prefs_ = NULL;
125 user_prefs_ = new TestingPrefStore; 127 user_prefs_ = new TestingPrefStore;
126 return pref_service; 128 return pref_service;
127 } 129 }
OLDNEW
« no previous file with comments | « chrome/browser/policy/policy_stubs.cc ('k') | chrome/browser/prefs/pref_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698