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

Side by Side Diff: chrome/browser/policy/policy_map.cc

Issue 8139029: Make policy errors available to display in about:policy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed unused replacement string DCHECK from policy_error_map.cc Created 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/policy/policy_map.h ('k') | chrome/browser/policy/policy_path_parser.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/policy_map.h" 5 #include "chrome/browser/policy/policy_map.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/stl_util.h" 9 #include "base/stl_util.h"
10 #include "policy/policy_constants.h" 10 #include "policy/policy_constants.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 Set(i->first, i->second->DeepCopy()); 46 Set(i->first, i->second->DeepCopy());
47 } 47 }
48 } 48 }
49 49
50 void PolicyMap::LoadFrom( 50 void PolicyMap::LoadFrom(
51 const DictionaryValue* policies, 51 const DictionaryValue* policies,
52 const PolicyDefinitionList* list) { 52 const PolicyDefinitionList* list) {
53 const PolicyDefinitionList::Entry* entry; 53 const PolicyDefinitionList::Entry* entry;
54 for (entry = list->begin; entry != list->end; ++entry) { 54 for (entry = list->begin; entry != list->end; ++entry) {
55 Value* value; 55 Value* value;
56 if (policies->Get(entry->name, &value) && value->IsType(entry->value_type)) 56 if (policies->Get(entry->name, &value))
57 Set(entry->policy_type, value->DeepCopy()); 57 Set(entry->policy_type, value->DeepCopy());
58 } 58 }
59 } 59 }
60 60
61 bool PolicyMap::Equals(const PolicyMap& other) const { 61 bool PolicyMap::Equals(const PolicyMap& other) const {
62 return other.map_.size() == map_.size() && 62 return other.map_.size() == map_.size() &&
63 std::equal(map_.begin(), map_.end(), other.map_.begin(), MapEntryEquals); 63 std::equal(map_.begin(), map_.end(), other.map_.begin(), MapEntryEquals);
64 } 64 }
65 65
66 bool PolicyMap::empty() const { 66 bool PolicyMap::empty() const {
(...skipping 16 matching lines...) Expand all
83 STLDeleteValues(&map_); 83 STLDeleteValues(&map_);
84 } 84 }
85 85
86 // static 86 // static
87 bool PolicyMap::MapEntryEquals(const PolicyMap::PolicyMapType::value_type& a, 87 bool PolicyMap::MapEntryEquals(const PolicyMap::PolicyMapType::value_type& a,
88 const PolicyMap::PolicyMapType::value_type& b) { 88 const PolicyMap::PolicyMapType::value_type& b) {
89 return a.first == b.first && Value::Equals(a.second, b.second); 89 return a.first == b.first && Value::Equals(a.second, b.second);
90 } 90 }
91 91
92 } // namespace policy 92 } // namespace policy
OLDNEW
« no previous file with comments | « chrome/browser/policy/policy_map.h ('k') | chrome/browser/policy/policy_path_parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698