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/policy/configuration_policy_pref_store.h" | 5 #include "chrome/browser/policy/configuration_policy_pref_store.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 const Value** value) const { | 74 const Value** value) const { |
75 const Value* stored_value = NULL; | 75 const Value* stored_value = NULL; |
76 if (!prefs_.get() || !prefs_->GetValue(key, &stored_value)) | 76 if (!prefs_.get() || !prefs_->GetValue(key, &stored_value)) |
77 return PrefStore::READ_NO_VALUE; | 77 return PrefStore::READ_NO_VALUE; |
78 | 78 |
79 if (value) | 79 if (value) |
80 *value = stored_value; | 80 *value = stored_value; |
81 return PrefStore::READ_OK; | 81 return PrefStore::READ_OK; |
82 } | 82 } |
83 | 83 |
84 void ConfigurationPolicyPrefStore::OnUpdatePolicy() { | 84 void ConfigurationPolicyPrefStore::OnUpdatePolicy( |
| 85 ConfigurationPolicyProvider* provider) { |
85 Refresh(); | 86 Refresh(); |
86 } | 87 } |
87 | 88 |
88 void ConfigurationPolicyPrefStore::OnProviderGoingAway() { | 89 void ConfigurationPolicyPrefStore::OnProviderGoingAway( |
| 90 ConfigurationPolicyProvider* provider) { |
89 provider_ = NULL; | 91 provider_ = NULL; |
90 } | 92 } |
91 | 93 |
92 // static | 94 // static |
93 ConfigurationPolicyPrefStore* | 95 ConfigurationPolicyPrefStore* |
94 ConfigurationPolicyPrefStore::CreateManagedPlatformPolicyPrefStore() { | 96 ConfigurationPolicyPrefStore::CreateManagedPlatformPolicyPrefStore() { |
95 return new ConfigurationPolicyPrefStore( | 97 return new ConfigurationPolicyPrefStore( |
96 g_browser_process->browser_policy_connector()-> | 98 g_browser_process->browser_policy_connector()-> |
97 GetManagedPlatformProvider()); | 99 GetManagedPlatformProvider()); |
98 } | 100 } |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 // issue during startup. | 172 // issue during startup. |
171 BrowserThread::PostTask(BrowserThread::UI, | 173 BrowserThread::PostTask(BrowserThread::UI, |
172 FROM_HERE, | 174 FROM_HERE, |
173 base::Bind(&LogErrors, | 175 base::Bind(&LogErrors, |
174 base::Owned(errors.release()))); | 176 base::Owned(errors.release()))); |
175 | 177 |
176 return prefs.release(); | 178 return prefs.release(); |
177 } | 179 } |
178 | 180 |
179 } // namespace policy | 181 } // namespace policy |
OLD | NEW |