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

Side by Side Diff: remoting/host/policy_watcher.cc

Issue 1825173003: [Policy Experimental] Add "recommended" policies for URL exceptions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sync. Created 4 years, 8 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
« no previous file with comments | « components/prefs/pref_value_store.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 // Most of this code is copied from: 5 // Most of this code is copied from:
6 // src/chrome/browser/policy/asynchronous_policy_loader.{h,cc} 6 // src/chrome/browser/policy/asynchronous_policy_loader.{h,cc}
7 7
8 #include "remoting/host/policy_watcher.h" 8 #include "remoting/host/policy_watcher.h"
9 9
10 #include <utility> 10 #include <utility>
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 scoped_ptr<policy::SchemaRegistry> schema_registry( 81 scoped_ptr<policy::SchemaRegistry> schema_registry(
82 new policy::SchemaRegistry()); 82 new policy::SchemaRegistry());
83 schema_registry->RegisterComponent(GetPolicyNamespace(), schema); 83 schema_registry->RegisterComponent(GetPolicyNamespace(), schema);
84 return schema_registry; 84 return schema_registry;
85 } 85 }
86 86
87 scoped_ptr<base::DictionaryValue> CopyChromotingPoliciesIntoDictionary( 87 scoped_ptr<base::DictionaryValue> CopyChromotingPoliciesIntoDictionary(
88 const policy::PolicyMap& current) { 88 const policy::PolicyMap& current) {
89 const char kPolicyNameSubstring[] = "RemoteAccessHost"; 89 const char kPolicyNameSubstring[] = "RemoteAccessHost";
90 scoped_ptr<base::DictionaryValue> policy_dict(new base::DictionaryValue()); 90 scoped_ptr<base::DictionaryValue> policy_dict(new base::DictionaryValue());
91 for (auto it = current.begin(); it != current.end(); ++it) { 91 for (auto it = current.begin(); it != current.end();
92 const std::string& key = it->first; 92 current.next_domominant(&it)) {
93 const std::string& key = it->first.name;
93 const base::Value* value = it->second.value; 94 const base::Value* value = it->second.value;
94 95
95 // Copying only Chromoting-specific policies helps avoid false alarms 96 // Copying only Chromoting-specific policies helps avoid false alarms
96 // raised by NormalizePolicies below (such alarms shutdown the host). 97 // raised by NormalizePolicies below (such alarms shutdown the host).
97 // TODO(lukasza): Removing this somewhat brittle filtering will be possible 98 // TODO(lukasza): Removing this somewhat brittle filtering will be possible
98 // after having separate, Chromoting-specific schema. 99 // after having separate, Chromoting-specific schema.
99 if (key.find(kPolicyNameSubstring) != std::string::npos) { 100 if (key.find(kPolicyNameSubstring) != std::string::npos) {
100 policy_dict->Set(key, value->DeepCopy()); 101 policy_dict->Set(key, value->DeepCopy());
101 } 102 }
102 } 103 }
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 policy::POLICY_SCOPE_MACHINE)); 372 policy::POLICY_SCOPE_MACHINE));
372 #else 373 #else
373 #error OS that is not yet supported by PolicyWatcher code. 374 #error OS that is not yet supported by PolicyWatcher code.
374 #endif 375 #endif
375 376
376 return PolicyWatcher::CreateFromPolicyLoader(std::move(policy_loader)); 377 return PolicyWatcher::CreateFromPolicyLoader(std::move(policy_loader));
377 #endif // !(OS_CHROMEOS) 378 #endif // !(OS_CHROMEOS)
378 } 379 }
379 380
380 } // namespace remoting 381 } // namespace remoting
OLDNEW
« no previous file with comments | « components/prefs/pref_value_store.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698