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

Side by Side Diff: chrome/browser/chromeos/policy/configuration_policy_handler_chromeos.cc

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: 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 (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/chromeos/policy/configuration_policy_handler_chromeos.h " 5 #include "chrome/browser/chromeos/policy/configuration_policy_handler_chromeos.h "
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 258
259 void NetworkConfigurationPolicyHandler::PrepareForDisplaying( 259 void NetworkConfigurationPolicyHandler::PrepareForDisplaying(
260 PolicyMap* policies) const { 260 PolicyMap* policies) const {
261 const PolicyMap::Entry* entry = policies->Get(policy_name()); 261 const PolicyMap::Entry* entry = policies->Get(policy_name());
262 if (!entry) 262 if (!entry)
263 return; 263 return;
264 base::Value* sanitized_config = SanitizeNetworkConfig(entry->value); 264 base::Value* sanitized_config = SanitizeNetworkConfig(entry->value);
265 if (!sanitized_config) 265 if (!sanitized_config)
266 sanitized_config = base::Value::CreateNullValue().release(); 266 sanitized_config = base::Value::CreateNullValue().release();
267 267
268 policies->Set(policy_name(), entry->level, entry->scope, 268 policies->SetWithSource(policy_name(),
269 sanitized_config, NULL); 269 entry->level,
270 entry->scope,
271 sanitized_config,
272 NULL,
bartfab (slow) 2015/09/14 14:42:25 Nit: s/NULL/nullptr/
fhorschig 2015/09/16 13:52:03 Done.
273 entry->source);
270 } 274 }
271 275
272 NetworkConfigurationPolicyHandler::NetworkConfigurationPolicyHandler( 276 NetworkConfigurationPolicyHandler::NetworkConfigurationPolicyHandler(
273 const char* policy_name, 277 const char* policy_name,
274 onc::ONCSource onc_source, 278 onc::ONCSource onc_source,
275 const char* pref_path) 279 const char* pref_path)
276 : TypeCheckingPolicyHandler(policy_name, base::Value::TYPE_STRING), 280 : TypeCheckingPolicyHandler(policy_name, base::Value::TYPE_STRING),
277 onc_source_(onc_source), 281 onc_source_(onc_source),
278 pref_path_(pref_path) { 282 pref_path_(pref_path) {
279 } 283 }
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
472 476
473 value = GetValue(dict, kScreenLockDelayAC); 477 value = GetValue(dict, kScreenLockDelayAC);
474 if (value) 478 if (value)
475 prefs->SetValue(prefs::kPowerAcScreenLockDelayMs, value.Pass()); 479 prefs->SetValue(prefs::kPowerAcScreenLockDelayMs, value.Pass());
476 value = GetValue(dict, kScreenLockDelayBattery); 480 value = GetValue(dict, kScreenLockDelayBattery);
477 if (value) 481 if (value)
478 prefs->SetValue(prefs::kPowerBatteryScreenLockDelayMs, value.Pass()); 482 prefs->SetValue(prefs::kPowerBatteryScreenLockDelayMs, value.Pass());
479 } 483 }
480 484
481 } // namespace policy 485 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698