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

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: 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
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 9475b2a61870bdc6c85f91348d8594eaf5555755..534cdf907b76ce06a8ca2967c35781bbb2323291 100644
--- a/chrome/browser/policy/policy_loader_mac.cc
+++ b/chrome/browser/policy/policy_loader_mac.cc
@@ -60,11 +60,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) {}
@@ -83,17 +81,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, ""));
bartfab (slow) 2013/11/05 18:18:33 Nit: #include "components/policy/core/common/polic
Joao da Silva 2013/11/07 20:27:27 Already in .h, for the PolicyDomain type
+ 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())
@@ -106,7 +104,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);
}

Powered by Google App Engine
This is Rietveld 408576698