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

Unified Diff: remoting/host/policy_hack/policy_watcher.cc

Issue 820133002: Reusing names of policy keys from policy_constants.h (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Marked the 5 "new" policies as chrome_os:42- Created 5 years, 11 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 | « remoting/host/policy_hack/policy_watcher.h ('k') | remoting/host/policy_hack/policy_watcher_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/policy_hack/policy_watcher.cc
diff --git a/remoting/host/policy_hack/policy_watcher.cc b/remoting/host/policy_hack/policy_watcher.cc
index a4afb746ad7defb88a8d9c6abda9fa3fdefdd4a6..234efdcb805e7b6d5c1f22962a973f7cc671a615 100644
--- a/remoting/host/policy_hack/policy_watcher.cc
+++ b/remoting/host/policy_hack/policy_watcher.cc
@@ -14,6 +14,7 @@
#include "base/single_thread_task_runner.h"
#include "base/time/time.h"
#include "base/values.h"
+#include "policy/policy_constants.h"
#include "remoting/host/dns_blackhole_checker.h"
#if !defined(NDEBUG)
@@ -58,7 +59,7 @@ scoped_ptr<base::DictionaryValue> CopyGoodValuesAndAddDefaults(
#if !defined(NDEBUG)
// Replace values with those specified in DebugOverridePolicies, if present.
std::string policy_overrides;
- if (from->GetString(PolicyWatcher::kHostDebugOverridePoliciesName,
+ if (from->GetString(policy::key::kRemoteAccessHostDebugOverridePolicies,
&policy_overrides)) {
scoped_ptr<base::Value> value(base::JSONReader::Read(policy_overrides));
const base::DictionaryValue* override_values;
@@ -73,48 +74,6 @@ scoped_ptr<base::DictionaryValue> CopyGoodValuesAndAddDefaults(
} // namespace
-const char PolicyWatcher::kNatPolicyName[] =
- "RemoteAccessHostFirewallTraversal";
-
-const char PolicyWatcher::kHostRequireTwoFactorPolicyName[] =
- "RemoteAccessHostRequireTwoFactor";
-
-const char PolicyWatcher::kHostDomainPolicyName[] =
- "RemoteAccessHostDomain";
-
-const char PolicyWatcher::kHostMatchUsernamePolicyName[] =
- "RemoteAccessHostMatchUsername";
-
-const char PolicyWatcher::kHostTalkGadgetPrefixPolicyName[] =
- "RemoteAccessHostTalkGadgetPrefix";
-
-const char PolicyWatcher::kHostRequireCurtainPolicyName[] =
- "RemoteAccessHostRequireCurtain";
-
-const char PolicyWatcher::kHostTokenUrlPolicyName[] =
- "RemoteAccessHostTokenUrl";
-
-const char PolicyWatcher::kHostTokenValidationUrlPolicyName[] =
- "RemoteAccessHostTokenValidationUrl";
-
-const char PolicyWatcher::kHostTokenValidationCertIssuerPolicyName[] =
- "RemoteAccessHostTokenValidationCertificateIssuer";
-
-const char PolicyWatcher::kHostAllowClientPairing[] =
- "RemoteAccessHostAllowClientPairing";
-
-const char PolicyWatcher::kHostAllowGnubbyAuthPolicyName[] =
- "RemoteAccessHostAllowGnubbyAuth";
-
-const char PolicyWatcher::kRelayPolicyName[] =
- "RemoteAccessHostAllowRelayedConnection";
-
-const char PolicyWatcher::kUdpPortRangePolicyName[] =
- "RemoteAccessHostUdpPortRange";
-
-const char PolicyWatcher::kHostDebugOverridePoliciesName[] =
- "RemoteAccessHostDebugOverridePolicies";
-
PolicyWatcher::PolicyWatcher(
scoped_refptr<base::SingleThreadTaskRunner> task_runner)
: task_runner_(task_runner),
@@ -123,30 +82,44 @@ PolicyWatcher::PolicyWatcher(
default_values_(new base::DictionaryValue()),
weak_factory_(this) {
// Initialize the default values for each policy.
- default_values_->SetBoolean(kNatPolicyName, true);
- default_values_->SetBoolean(kHostRequireTwoFactorPolicyName, false);
- default_values_->SetBoolean(kHostRequireCurtainPolicyName, false);
- default_values_->SetBoolean(kHostMatchUsernamePolicyName, false);
- default_values_->SetString(kHostDomainPolicyName, std::string());
- default_values_->SetString(kHostTalkGadgetPrefixPolicyName,
- kDefaultHostTalkGadgetPrefix);
- default_values_->SetString(kHostTokenUrlPolicyName, std::string());
- default_values_->SetString(kHostTokenValidationUrlPolicyName, std::string());
- default_values_->SetString(kHostTokenValidationCertIssuerPolicyName,
+ default_values_->SetBoolean(policy::key::kRemoteAccessHostFirewallTraversal,
+ true);
+ default_values_->SetBoolean(policy::key::kRemoteAccessHostRequireTwoFactor,
+ false);
+ default_values_->SetBoolean(policy::key::kRemoteAccessHostRequireCurtain,
+ false);
+ default_values_->SetBoolean(policy::key::kRemoteAccessHostMatchUsername,
+ false);
+ default_values_->SetString(policy::key::kRemoteAccessHostDomain,
+ std::string());
+ default_values_->SetString(policy::key::kRemoteAccessHostTalkGadgetPrefix,
+ kDefaultHostTalkGadgetPrefix);
+ default_values_->SetString(policy::key::kRemoteAccessHostTokenUrl,
+ std::string());
+ default_values_->SetString(policy::key::kRemoteAccessHostTokenValidationUrl,
std::string());
- default_values_->SetBoolean(kHostAllowClientPairing, true);
- default_values_->SetBoolean(kHostAllowGnubbyAuthPolicyName, true);
- default_values_->SetBoolean(kRelayPolicyName, true);
- default_values_->SetString(kUdpPortRangePolicyName, "");
+ default_values_->SetString(
+ policy::key::kRemoteAccessHostTokenValidationCertificateIssuer,
+ std::string());
+ default_values_->SetBoolean(policy::key::kRemoteAccessHostAllowClientPairing,
+ true);
+ default_values_->SetBoolean(policy::key::kRemoteAccessHostAllowGnubbyAuth,
+ true);
+ default_values_->SetBoolean(
+ policy::key::kRemoteAccessHostAllowRelayedConnection, true);
+ default_values_->SetString(policy::key::kRemoteAccessHostUdpPortRange, "");
#if !defined(NDEBUG)
- default_values_->SetString(kHostDebugOverridePoliciesName, std::string());
+ default_values_->SetString(
+ policy::key::kRemoteAccessHostDebugOverridePolicies, std::string());
#endif
// Initialize the fall-back values to use for unreadable policies.
// For most policies these match the defaults.
bad_type_values_.reset(default_values_->DeepCopy());
- bad_type_values_->SetBoolean(kNatPolicyName, false);
- bad_type_values_->SetBoolean(kRelayPolicyName, false);
+ bad_type_values_->SetBoolean(policy::key::kRemoteAccessHostFirewallTraversal,
+ false);
+ bad_type_values_->SetBoolean(
+ policy::key::kRemoteAccessHostAllowRelayedConnection, false);
}
PolicyWatcher::~PolicyWatcher() {
« no previous file with comments | « remoting/host/policy_hack/policy_watcher.h ('k') | remoting/host/policy_hack/policy_watcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698