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

Unified Diff: components/policy/core/common/policy_map.cc

Issue 1350913006: Revert of 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/policy/core/common/policy_map.h ('k') | components/policy/core/common/policy_map_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/policy/core/common/policy_map.cc
diff --git a/components/policy/core/common/policy_map.cc b/components/policy/core/common/policy_map.cc
index 84b8fd8de361888098c7638ff0e130f141407ce3..5e1fd5b06375e385c61a8bb66bd9b67e702c1ea6 100644
--- a/components/policy/core/common/policy_map.cc
+++ b/components/policy/core/common/policy_map.cc
@@ -28,7 +28,6 @@
scoped_ptr<Entry> copy(new Entry);
copy->level = level;
copy->scope = scope;
- copy->source = source;
if (value)
copy->value = value->DeepCopy();
if (external_data_fetcher) {
@@ -49,8 +48,6 @@
bool PolicyMap::Entry::Equals(const PolicyMap::Entry& other) const {
return level == other.level &&
scope == other.scope &&
- source == other.source && // Necessary for PolicyUIHandler observers.
- // They have to update when sources change.
base::Value::Equals(value, other.value) &&
ExternalDataFetcher::Equals(external_data_fetcher,
other.external_data_fetcher);
@@ -76,14 +73,12 @@
void PolicyMap::Set(const std::string& policy,
PolicyLevel level,
PolicyScope scope,
- PolicySource source,
base::Value* value,
ExternalDataFetcher* external_data_fetcher) {
Entry& entry = map_[policy];
entry.DeleteOwnedMembers();
entry.level = level;
entry.scope = scope;
- entry.source = source;
entry.value = value;
entry.external_data_fetcher = external_data_fetcher;
}
@@ -104,11 +99,9 @@
Clear();
for (const_iterator it = other.begin(); it != other.end(); ++it) {
const Entry& entry = it->second;
- Set(it->first, entry.level, entry.scope, entry.source,
- entry.value->DeepCopy(),
- entry.external_data_fetcher
- ? new ExternalDataFetcher(*entry.external_data_fetcher)
- : nullptr);
+ Set(it->first, entry.level, entry.scope,
+ entry.value->DeepCopy(), entry.external_data_fetcher ?
+ new ExternalDataFetcher(*entry.external_data_fetcher) : NULL);
}
}
@@ -122,12 +115,10 @@
for (const_iterator it = other.begin(); it != other.end(); ++it) {
const Entry* entry = Get(it->first);
if (!entry || it->second.has_higher_priority_than(*entry)) {
- Set(it->first, it->second.level, it->second.scope, it->second.source,
- it->second.value->DeepCopy(),
- it->second.external_data_fetcher
- ? new ExternalDataFetcher(
- *it->second.external_data_fetcher)
- : nullptr);
+ Set(it->first, it->second.level, it->second.scope,
+ it->second.value->DeepCopy(), it->second.external_data_fetcher ?
+ new ExternalDataFetcher(*it->second.external_data_fetcher) :
+ NULL);
}
}
}
@@ -135,11 +126,10 @@
void PolicyMap::LoadFrom(
const base::DictionaryValue* policies,
PolicyLevel level,
- PolicyScope scope,
- PolicySource source) {
+ PolicyScope scope) {
for (base::DictionaryValue::Iterator it(*policies);
!it.IsAtEnd(); it.Advance()) {
- Set(it.key(), level, scope, source, it.value().DeepCopy(), nullptr);
+ Set(it.key(), level, scope, it.value().DeepCopy(), NULL);
}
}
« no previous file with comments | « components/policy/core/common/policy_map.h ('k') | components/policy/core/common/policy_map_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698