| OLD | NEW |
| 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 #include "remoting/host/policy_watcher.h" | 5 #include "remoting/host/policy_watcher.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/json/json_writer.h" | 8 #include "base/json/json_writer.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 base::DictionaryValue third_party_auth_cert_empty_; | 244 base::DictionaryValue third_party_auth_cert_empty_; |
| 245 base::DictionaryValue remote_assistance_uiaccess_true_; | 245 base::DictionaryValue remote_assistance_uiaccess_true_; |
| 246 base::DictionaryValue remote_assistance_uiaccess_false_; | 246 base::DictionaryValue remote_assistance_uiaccess_false_; |
| 247 | 247 |
| 248 private: | 248 private: |
| 249 void SetDefaults(base::DictionaryValue& dict) { | 249 void SetDefaults(base::DictionaryValue& dict) { |
| 250 dict.SetBoolean(key::kRemoteAccessHostFirewallTraversal, true); | 250 dict.SetBoolean(key::kRemoteAccessHostFirewallTraversal, true); |
| 251 dict.SetBoolean(key::kRemoteAccessHostAllowRelayedConnection, true); | 251 dict.SetBoolean(key::kRemoteAccessHostAllowRelayedConnection, true); |
| 252 dict.SetString(key::kRemoteAccessHostUdpPortRange, ""); | 252 dict.SetString(key::kRemoteAccessHostUdpPortRange, ""); |
| 253 dict.SetString(key::kRemoteAccessHostClientDomain, std::string()); | 253 dict.SetString(key::kRemoteAccessHostClientDomain, std::string()); |
| 254 dict.Set(key::kRemoteAccessHostClientDomainList, |
| 255 base::MakeUnique<base::ListValue>()); |
| 254 dict.SetString(key::kRemoteAccessHostDomain, std::string()); | 256 dict.SetString(key::kRemoteAccessHostDomain, std::string()); |
| 257 dict.Set(key::kRemoteAccessHostDomainList, |
| 258 base::MakeUnique<base::ListValue>()); |
| 255 dict.SetBoolean(key::kRemoteAccessHostMatchUsername, false); | 259 dict.SetBoolean(key::kRemoteAccessHostMatchUsername, false); |
| 256 dict.SetString(key::kRemoteAccessHostTalkGadgetPrefix, | 260 dict.SetString(key::kRemoteAccessHostTalkGadgetPrefix, |
| 257 kDefaultHostTalkGadgetPrefix); | 261 kDefaultHostTalkGadgetPrefix); |
| 258 dict.SetBoolean(key::kRemoteAccessHostRequireCurtain, false); | 262 dict.SetBoolean(key::kRemoteAccessHostRequireCurtain, false); |
| 259 dict.SetString(key::kRemoteAccessHostTokenUrl, ""); | 263 dict.SetString(key::kRemoteAccessHostTokenUrl, ""); |
| 260 dict.SetString(key::kRemoteAccessHostTokenValidationUrl, ""); | 264 dict.SetString(key::kRemoteAccessHostTokenValidationUrl, ""); |
| 261 dict.SetString(key::kRemoteAccessHostTokenValidationCertificateIssuer, ""); | 265 dict.SetString(key::kRemoteAccessHostTokenValidationCertificateIssuer, ""); |
| 262 dict.SetBoolean(key::kRemoteAccessHostAllowClientPairing, true); | 266 dict.SetBoolean(key::kRemoteAccessHostAllowClientPairing, true); |
| 263 dict.SetBoolean(key::kRemoteAccessHostAllowGnubbyAuth, true); | 267 dict.SetBoolean(key::kRemoteAccessHostAllowGnubbyAuth, true); |
| 264 dict.SetBoolean(key::kRemoteAccessHostAllowUiAccessForRemoteAssistance, | 268 dict.SetBoolean(key::kRemoteAccessHostAllowUiAccessForRemoteAssistance, |
| (...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 678 | 682 |
| 679 // And check one, random "boolean" policy to see if the type propagated | 683 // And check one, random "boolean" policy to see if the type propagated |
| 680 // correctly from policy_templates.json file. | 684 // correctly from policy_templates.json file. |
| 681 const policy::Schema boolean_schema = | 685 const policy::Schema boolean_schema = |
| 682 schema->GetKnownProperty("RemoteAccessHostRequireCurtain"); | 686 schema->GetKnownProperty("RemoteAccessHostRequireCurtain"); |
| 683 EXPECT_TRUE(boolean_schema.valid()); | 687 EXPECT_TRUE(boolean_schema.valid()); |
| 684 EXPECT_EQ(boolean_schema.type(), base::Value::Type::BOOLEAN); | 688 EXPECT_EQ(boolean_schema.type(), base::Value::Type::BOOLEAN); |
| 685 } | 689 } |
| 686 | 690 |
| 687 } // namespace remoting | 691 } // namespace remoting |
| OLD | NEW |