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

Unified Diff: chrome/browser/policy/policy_loader_mac.cc

Issue 58313002: Removed the PolicyDefinitionList. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@chrome-policy-schema-10-use-registry
Patch Set: rebase Created 7 years, 1 month 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
« no previous file with comments | « chrome/browser/policy/policy_loader_mac.h ('k') | chrome/browser/policy/policy_loader_mac_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/policy/policy_loader_mac.cc
diff --git a/chrome/browser/policy/policy_loader_mac.cc b/chrome/browser/policy/policy_loader_mac.cc
index 50b0cf256310eea3ec351d7ebae55e3eb7123ba4..63c3132e94e84038230bd21481a6567b13464ffd 100644
--- a/chrome/browser/policy/policy_loader_mac.cc
+++ b/chrome/browser/policy/policy_loader_mac.cc
@@ -61,11 +61,9 @@ void ArrayEntryToValue(const void* value, void* context) {
PolicyLoaderMac::PolicyLoaderMac(
scoped_refptr<base::SequencedTaskRunner> task_runner,
- const PolicyDefinitionList* policy_list,
const base::FilePath& managed_policy_path,
MacPreferences* preferences)
: AsyncPolicyLoader(task_runner),
- policy_list_(policy_list),
preferences_(preferences),
managed_policy_path_(managed_policy_path) {}
@@ -84,17 +82,17 @@ scoped_ptr<PolicyBundle> PolicyLoaderMac::Load() {
scoped_ptr<PolicyBundle> bundle(new PolicyBundle());
// Load Chrome's policy.
- // TODO(joaodasilva): Use the Chrome schema instead of the
- // PolicyDefinitionList.
PolicyMap& chrome_policy =
bundle->Get(PolicyNamespace(POLICY_DOMAIN_CHROME, std::string()));
PolicyLoadStatusSample status;
bool policy_present = false;
- const PolicyDefinitionList::Entry* current;
- for (current = policy_list_->begin; current != policy_list_->end; ++current) {
+ const Schema* schema =
+ schema_map()->GetSchema(PolicyNamespace(POLICY_DOMAIN_CHROME, ""));
+ for (Schema::Iterator it = schema->GetPropertiesIterator();
+ !it.IsAtEnd(); it.Advance()) {
base::ScopedCFTypeRef<CFStringRef> name(
- base::SysUTF8ToCFStringRef(current->name));
+ base::SysUTF8ToCFStringRef(it.key()));
base::ScopedCFTypeRef<CFPropertyListRef> value(
preferences_->CopyAppValue(name, kCFPreferencesCurrentApplication));
if (!value.get())
@@ -107,7 +105,7 @@ scoped_ptr<PolicyBundle> PolicyLoaderMac::Load() {
// TODO(joaodasilva): figure the policy scope.
base::Value* policy = CreateValueFromProperty(value);
if (policy)
- chrome_policy.Set(current->name, level, POLICY_SCOPE_USER, policy, NULL);
+ chrome_policy.Set(it.key(), level, POLICY_SCOPE_USER, policy, NULL);
else
status.Add(POLICY_LOAD_STATUS_PARSE_ERROR);
}
« no previous file with comments | « chrome/browser/policy/policy_loader_mac.h ('k') | chrome/browser/policy/policy_loader_mac_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698