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

Unified Diff: remoting/host/remoting_me2me_host.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: Created 6 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 side-by-side diff with in-line comments
Download patch
Index: remoting/host/remoting_me2me_host.cc
diff --git a/remoting/host/remoting_me2me_host.cc b/remoting/host/remoting_me2me_host.cc
index f2aa98331acea8f1f8076cf4540bed9a2c5220c0..8946f1a45c5a09e750ba629285a458be823d6ab5 100644
--- a/remoting/host/remoting_me2me_host.cc
+++ b/remoting/host/remoting_me2me_host.cc
@@ -30,6 +30,7 @@
#include "net/socket/client_socket_factory.h"
#include "net/socket/ssl_server_socket.h"
#include "net/url_request/url_fetcher.h"
+#include "policy/policy_constants.h"
#include "remoting/base/auto_thread_task_runner.h"
#include "remoting/base/breakpad.h"
#include "remoting/base/constants.h"
@@ -963,8 +964,8 @@ bool HostProcess::OnHostDomainPolicyUpdate(base::DictionaryValue* policies) {
// Returns true if the host has to be restarted after this policy update.
DCHECK(context_->network_task_runner()->BelongsToCurrentThread());
- if (!policies->GetString(policy_hack::PolicyWatcher::kHostDomainPolicyName,
- &host_domain_)) {
+ if (!policies->GetString(policy::key::kRemoteAccessHostDomain,
+ &host_domain_)) {
return false;
}
@@ -1019,9 +1020,8 @@ bool HostProcess::OnUsernamePolicyUpdate(base::DictionaryValue* policies) {
// Returns false: never restart the host after this policy update.
DCHECK(context_->network_task_runner()->BelongsToCurrentThread());
- if (!policies->GetBoolean(
- policy_hack::PolicyWatcher::kHostMatchUsernamePolicyName,
- &host_username_match_required_)) {
+ if (!policies->GetBoolean(policy::key::kRemoteAccessHostMatchUsername,
+ &host_username_match_required_)) {
return false;
}
@@ -1033,8 +1033,8 @@ bool HostProcess::OnNatPolicyUpdate(base::DictionaryValue* policies) {
// Returns true if the host has to be restarted after this policy update.
DCHECK(context_->network_task_runner()->BelongsToCurrentThread());
- if (!policies->GetBoolean(policy_hack::PolicyWatcher::kNatPolicyName,
- &allow_nat_traversal_)) {
+ if (!policies->GetBoolean(policy::key::kRemoteAccessHostFirewallTraversal,
+ &allow_nat_traversal_)) {
return false;
}
@@ -1050,8 +1050,9 @@ bool HostProcess::OnRelayPolicyUpdate(base::DictionaryValue* policies) {
// Returns true if the host has to be restarted after this policy update.
DCHECK(context_->network_task_runner()->BelongsToCurrentThread());
- if (!policies->GetBoolean(policy_hack::PolicyWatcher::kRelayPolicyName,
- &allow_relay_)) {
+ if (!policies->GetBoolean(
+ policy::key::kRemoteAccessHostAllowRelayedConnection,
+ &allow_relay_)) {
return false;
}
@@ -1068,7 +1069,7 @@ bool HostProcess::OnUdpPortPolicyUpdate(base::DictionaryValue* policies) {
DCHECK(context_->network_task_runner()->BelongsToCurrentThread());
std::string udp_port_range;
- if (!policies->GetString(policy_hack::PolicyWatcher::kUdpPortRangePolicyName,
+ if (!policies->GetString(policy::key::kRemoteAccessHostUdpPortRange,
&udp_port_range)) {
return false;
}
@@ -1101,9 +1102,8 @@ bool HostProcess::OnCurtainPolicyUpdate(base::DictionaryValue* policies) {
// Returns true if the host has to be restarted after this policy update.
DCHECK(context_->network_task_runner()->BelongsToCurrentThread());
- if (!policies->GetBoolean(
- policy_hack::PolicyWatcher::kHostRequireCurtainPolicyName,
- &curtain_required_)) {
+ if (!policies->GetBoolean(policy::key::kRemoteAccessHostRequireCurtain,
+ &curtain_required_)) {
return false;
}
@@ -1143,9 +1143,8 @@ bool HostProcess::OnHostTalkGadgetPrefixPolicyUpdate(
// Returns true if the host has to be restarted after this policy update.
DCHECK(context_->network_task_runner()->BelongsToCurrentThread());
- if (!policies->GetString(
- policy_hack::PolicyWatcher::kHostTalkGadgetPrefixPolicyName,
- &talkgadget_prefix_)) {
+ if (!policies->GetString(policy::key::kRemoteAccessHostTalkGadgetPrefix,
+ &talkgadget_prefix_)) {
return false;
}
@@ -1159,22 +1158,20 @@ bool HostProcess::OnHostTokenUrlPolicyUpdate(base::DictionaryValue* policies) {
bool token_policy_changed = false;
std::string token_url_string;
- if (policies->GetString(
- policy_hack::PolicyWatcher::kHostTokenUrlPolicyName,
- &token_url_string)) {
+ if (policies->GetString(policy::key::kRemoteAccessHostTokenUrl,
+ &token_url_string)) {
token_policy_changed = true;
third_party_auth_config_.token_url = GURL(token_url_string);
}
std::string token_validation_url_string;
- if (policies->GetString(
- policy_hack::PolicyWatcher::kHostTokenValidationUrlPolicyName,
- &token_validation_url_string)) {
+ if (policies->GetString(policy::key::kRemoteAccessHostTokenValidationUrl,
+ &token_validation_url_string)) {
token_policy_changed = true;
third_party_auth_config_.token_validation_url =
GURL(token_validation_url_string);
}
if (policies->GetString(
- policy_hack::PolicyWatcher::kHostTokenValidationCertIssuerPolicyName,
+ policy::key::kRemoteAccessHostTokenValidationCertificateIssuer,
&third_party_auth_config_.token_validation_cert_issuer)) {
token_policy_changed = true;
}
@@ -1194,9 +1191,8 @@ bool HostProcess::OnHostTokenUrlPolicyUpdate(base::DictionaryValue* policies) {
bool HostProcess::OnPairingPolicyUpdate(base::DictionaryValue* policies) {
DCHECK(context_->network_task_runner()->BelongsToCurrentThread());
- if (!policies->GetBoolean(
- policy_hack::PolicyWatcher::kHostAllowClientPairing,
- &allow_pairing_)) {
+ if (!policies->GetBoolean(policy::key::kRemoteAccessHostAllowClientPairing,
+ &allow_pairing_)) {
return false;
}
@@ -1211,9 +1207,8 @@ bool HostProcess::OnPairingPolicyUpdate(base::DictionaryValue* policies) {
bool HostProcess::OnGnubbyAuthPolicyUpdate(base::DictionaryValue* policies) {
DCHECK(context_->network_task_runner()->BelongsToCurrentThread());
- if (!policies->GetBoolean(
- policy_hack::PolicyWatcher::kHostAllowGnubbyAuthPolicyName,
- &enable_gnubby_auth_)) {
+ if (!policies->GetBoolean(policy::key::kRemoteAccessHostAllowGnubbyAuth,
+ &enable_gnubby_auth_)) {
return false;
}

Powered by Google App Engine
This is Rietveld 408576698