OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |