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

Side by Side Diff: components/policy/core/common/policy_loader_ios.mm

Issue 1304843004: Add source column to chrome://policy showing the origins of policies. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed another test. Created 5 years, 3 months 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "components/policy/core/common/policy_loader_ios.h" 5 #include "components/policy/core/common/policy_loader_ios.h"
6 6
7 #import <Foundation/Foundation.h> 7 #import <Foundation/Foundation.h>
8 #import <UIKit/UIKit.h> 8 #import <UIKit/UIKit.h>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 // static 170 // static
171 void PolicyLoaderIOS::LoadNSDictionaryToPolicyBundle(NSDictionary* dictionary, 171 void PolicyLoaderIOS::LoadNSDictionaryToPolicyBundle(NSDictionary* dictionary,
172 PolicyBundle* bundle) { 172 PolicyBundle* bundle) {
173 // NSDictionary is toll-free bridged to CFDictionaryRef, which is a 173 // NSDictionary is toll-free bridged to CFDictionaryRef, which is a
174 // CFPropertyListRef. 174 // CFPropertyListRef.
175 scoped_ptr<base::Value> value = 175 scoped_ptr<base::Value> value =
176 PropertyToValue(static_cast<CFPropertyListRef>(dictionary)); 176 PropertyToValue(static_cast<CFPropertyListRef>(dictionary));
177 base::DictionaryValue* dict = NULL; 177 base::DictionaryValue* dict = NULL;
178 if (value && value->GetAsDictionary(&dict)) { 178 if (value && value->GetAsDictionary(&dict)) {
179 PolicyMap& map = bundle->Get(PolicyNamespace(POLICY_DOMAIN_CHROME, "")); 179 PolicyMap& map = bundle->Get(PolicyNamespace(POLICY_DOMAIN_CHROME, ""));
180 map.LoadFrom(dict, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_MACHINE); 180 map.LoadFrom(dict, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_MACHINE,
181 POLICY_SOURCE_PLATFORM);
181 } 182 }
182 } 183 }
183 184
184 } // namespace policy 185 } // namespace policy
OLDNEW
« no previous file with comments | « components/policy/core/common/policy_bundle_unittest.cc ('k') | components/policy/core/common/policy_loader_ios_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698