| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_hack/policy_watcher.h" | 8 #include "remoting/host/policy_hack/policy_watcher.h" |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 CopyBooleanOrDefault(to.get(), from, | 90 CopyBooleanOrDefault(to.get(), from, |
| 91 PolicyWatcher::kNatPolicyName, true, false); | 91 PolicyWatcher::kNatPolicyName, true, false); |
| 92 CopyBooleanOrDefault(to.get(), from, | 92 CopyBooleanOrDefault(to.get(), from, |
| 93 PolicyWatcher::kHostRequireTwoFactorPolicyName, | 93 PolicyWatcher::kHostRequireTwoFactorPolicyName, |
| 94 false, false); | 94 false, false); |
| 95 CopyStringOrDefault(to.get(), from, | 95 CopyStringOrDefault(to.get(), from, |
| 96 PolicyWatcher::kHostDomainPolicyName, "", ""); | 96 PolicyWatcher::kHostDomainPolicyName, "", ""); |
| 97 CopyStringOrDefault(to.get(), from, | 97 CopyStringOrDefault(to.get(), from, |
| 98 PolicyWatcher::kHostTalkGadgetPrefixPolicyName, | 98 PolicyWatcher::kHostTalkGadgetPrefixPolicyName, |
| 99 kDefaultTalkGadgetPrefix, kDefaultTalkGadgetPrefix); | 99 kDefaultTalkGadgetPrefix, kDefaultTalkGadgetPrefix); |
| 100 CopyBooleanOrDefault(to.get(), from, |
| 101 PolicyWatcher::kHostRequireCurtainPolicyName, |
| 102 false, false); |
| 100 | 103 |
| 101 return to.Pass(); | 104 return to.Pass(); |
| 102 } | 105 } |
| 103 | 106 |
| 104 } // namespace | 107 } // namespace |
| 105 | 108 |
| 106 const char PolicyWatcher::kNatPolicyName[] = | 109 const char PolicyWatcher::kNatPolicyName[] = |
| 107 "RemoteAccessHostFirewallTraversal"; | 110 "RemoteAccessHostFirewallTraversal"; |
| 108 | 111 |
| 109 const char PolicyWatcher::kHostRequireTwoFactorPolicyName[] = | 112 const char PolicyWatcher::kHostRequireTwoFactorPolicyName[] = |
| 110 "RemoteAccessHostRequireTwoFactor"; | 113 "RemoteAccessHostRequireTwoFactor"; |
| 111 | 114 |
| 112 const char PolicyWatcher::kHostDomainPolicyName[] = | 115 const char PolicyWatcher::kHostDomainPolicyName[] = |
| 113 "RemoteAccessHostDomain"; | 116 "RemoteAccessHostDomain"; |
| 114 | 117 |
| 115 const char PolicyWatcher::kHostTalkGadgetPrefixPolicyName[] = | 118 const char PolicyWatcher::kHostTalkGadgetPrefixPolicyName[] = |
| 116 "RemoteAccessHostTalkGadgetPrefix"; | 119 "RemoteAccessHostTalkGadgetPrefix"; |
| 117 | 120 |
| 121 const char PolicyWatcher::kHostRequireCurtainPolicyName[] = |
| 122 "RemoteAccessHostRequireCurtain"; |
| 123 |
| 118 const char* const PolicyWatcher::kBooleanPolicyNames[] = | 124 const char* const PolicyWatcher::kBooleanPolicyNames[] = |
| 119 { PolicyWatcher::kNatPolicyName, | 125 { PolicyWatcher::kNatPolicyName, |
| 120 PolicyWatcher::kHostRequireTwoFactorPolicyName | 126 PolicyWatcher::kHostRequireTwoFactorPolicyName |
| 121 }; | 127 }; |
| 122 | 128 |
| 123 const int PolicyWatcher::kBooleanPolicyNamesNum = | 129 const int PolicyWatcher::kBooleanPolicyNamesNum = |
| 124 arraysize(kBooleanPolicyNames); | 130 arraysize(kBooleanPolicyNames); |
| 125 | 131 |
| 126 const char* const PolicyWatcher::kStringPolicyNames[] = | 132 const char* const PolicyWatcher::kStringPolicyNames[] = |
| 127 { PolicyWatcher::kHostDomainPolicyName, | 133 { PolicyWatcher::kHostDomainPolicyName, |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 old_policies_.swap(new_policies); | 218 old_policies_.swap(new_policies); |
| 213 | 219 |
| 214 // Notify our client of the changed policies. | 220 // Notify our client of the changed policies. |
| 215 if (!changed_policies->empty()) { | 221 if (!changed_policies->empty()) { |
| 216 policy_callback_.Run(changed_policies.Pass()); | 222 policy_callback_.Run(changed_policies.Pass()); |
| 217 } | 223 } |
| 218 } | 224 } |
| 219 | 225 |
| 220 } // namespace policy_hack | 226 } // namespace policy_hack |
| 221 } // namespace remoting | 227 } // namespace remoting |
| OLD | NEW |