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

Side by Side Diff: components/policy/core/common/policy_map.cc

Issue 88423002: Add CloudExternalDataPolicyObserverChromeOS (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Whitespace fix. Created 7 years 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_map.h" 5 #include "components/policy/core/common/policy_map.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
11 11
12 namespace policy { 12 namespace policy {
13 13
14 scoped_ptr<PolicyMap::Entry> PolicyMap::Entry::DeepCopy() const {
15 scoped_ptr<Entry> copy(new Entry);
16 copy->level = level;
17 copy->scope = scope;
18 if (value)
19 copy->value = value->DeepCopy();
20 if (external_data_fetcher) {
21 copy->external_data_fetcher =
22 new ExternalDataFetcher(*external_data_fetcher);
23 }
24 return copy.Pass();
25 }
26
14 bool PolicyMap::Entry::has_higher_priority_than( 27 bool PolicyMap::Entry::has_higher_priority_than(
15 const PolicyMap::Entry& other) const { 28 const PolicyMap::Entry& other) const {
16 if (level == other.level) 29 if (level == other.level)
17 return scope > other.scope; 30 return scope > other.scope;
18 else 31 else
19 return level > other.level; 32 return level > other.level;
20 } 33 }
21 34
22 bool PolicyMap::Entry::Equals(const PolicyMap::Entry& other) const { 35 bool PolicyMap::Entry::Equals(const PolicyMap::Entry& other) const {
23 return level == other.level && 36 return level == other.level &&
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 map_.clear(); 190 map_.clear();
178 } 191 }
179 192
180 // static 193 // static
181 bool PolicyMap::MapEntryEquals(const PolicyMap::PolicyMapType::value_type& a, 194 bool PolicyMap::MapEntryEquals(const PolicyMap::PolicyMapType::value_type& a,
182 const PolicyMap::PolicyMapType::value_type& b) { 195 const PolicyMap::PolicyMapType::value_type& b) {
183 return a.first == b.first && a.second.Equals(b.second); 196 return a.first == b.first && a.second.Equals(b.second);
184 } 197 }
185 198
186 } // namespace policy 199 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698