| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 } | 58 } |
| 59 | 59 |
| 60 size_t ConfigurationPolicyPrefStore::NumberOfObservers() const { | 60 size_t ConfigurationPolicyPrefStore::NumberOfObservers() const { |
| 61 return observers_.size(); | 61 return observers_.size(); |
| 62 } | 62 } |
| 63 | 63 |
| 64 bool ConfigurationPolicyPrefStore::IsInitializationComplete() const { | 64 bool ConfigurationPolicyPrefStore::IsInitializationComplete() const { |
| 65 return policy_service_->IsInitializationComplete(); | 65 return policy_service_->IsInitializationComplete(); |
| 66 } | 66 } |
| 67 | 67 |
| 68 PrefStore::ReadResult | 68 bool ConfigurationPolicyPrefStore::GetValue(const std::string& key, |
| 69 ConfigurationPolicyPrefStore::GetValue(const std::string& key, | 69 const Value** value) const { |
| 70 const Value** value) const { | |
| 71 const Value* stored_value = NULL; | 70 const Value* stored_value = NULL; |
| 72 if (!prefs_.get() || !prefs_->GetValue(key, &stored_value)) | 71 if (!prefs_.get() || !prefs_->GetValue(key, &stored_value)) |
| 73 return PrefStore::READ_NO_VALUE; | 72 return false; |
| 74 | 73 |
| 75 if (value) | 74 if (value) |
| 76 *value = stored_value; | 75 *value = stored_value; |
| 77 return PrefStore::READ_OK; | 76 return true; |
| 78 } | 77 } |
| 79 | 78 |
| 80 void ConfigurationPolicyPrefStore::OnPolicyUpdated( | 79 void ConfigurationPolicyPrefStore::OnPolicyUpdated( |
| 81 PolicyDomain domain, | 80 PolicyDomain domain, |
| 82 const std::string& component_id, | 81 const std::string& component_id, |
| 83 const PolicyMap& previous, | 82 const PolicyMap& previous, |
| 84 const PolicyMap& current) { | 83 const PolicyMap& current) { |
| 85 DCHECK_EQ(POLICY_DOMAIN_CHROME, domain); | 84 DCHECK_EQ(POLICY_DOMAIN_CHROME, domain); |
| 86 DCHECK_EQ("", component_id); | 85 DCHECK_EQ("", component_id); |
| 87 Refresh(); | 86 Refresh(); |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 // issue during startup. | 145 // issue during startup. |
| 147 BrowserThread::PostTask(BrowserThread::UI, | 146 BrowserThread::PostTask(BrowserThread::UI, |
| 148 FROM_HERE, | 147 FROM_HERE, |
| 149 base::Bind(&LogErrors, | 148 base::Bind(&LogErrors, |
| 150 base::Owned(errors.release()))); | 149 base::Owned(errors.release()))); |
| 151 | 150 |
| 152 return prefs.release(); | 151 return prefs.release(); |
| 153 } | 152 } |
| 154 | 153 |
| 155 } // namespace policy | 154 } // namespace policy |
| OLD | NEW |