| 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 #ifndef REMOTING_HOST_POLICY_HACK_POLICY_WATCHER_H_ | 5 #ifndef REMOTING_HOST_POLICY_HACK_POLICY_WATCHER_H_ |
| 6 #define REMOTING_HOST_POLICY_HACK_POLICY_WATCHER_H_ | 6 #define REMOTING_HOST_POLICY_HACK_POLICY_WATCHER_H_ |
| 7 | 7 |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 virtual void StopWatching(const base::Closure& stopped_callback); | 59 virtual void StopWatching(const base::Closure& stopped_callback); |
| 60 | 60 |
| 61 // Implemented by each platform. |task_runner| should be an IO message loop. | 61 // Implemented by each platform. |task_runner| should be an IO message loop. |
| 62 // |policy_service| is currently only used on ChromeOS. The caller must | 62 // |policy_service| is currently only used on ChromeOS. The caller must |
| 63 // ensure that |policy_service| remains valid for the lifetime of | 63 // ensure that |policy_service| remains valid for the lifetime of |
| 64 // PolicyWatcher. | 64 // PolicyWatcher. |
| 65 static scoped_ptr<PolicyWatcher> Create( | 65 static scoped_ptr<PolicyWatcher> Create( |
| 66 policy::PolicyService* policy_service, | 66 policy::PolicyService* policy_service, |
| 67 scoped_refptr<base::SingleThreadTaskRunner> task_runner); | 67 scoped_refptr<base::SingleThreadTaskRunner> task_runner); |
| 68 | 68 |
| 69 // The name of the NAT traversal policy. | |
| 70 static const char kNatPolicyName[]; | |
| 71 | |
| 72 // The name of the policy for requiring 2-factor authentication. | |
| 73 static const char kHostRequireTwoFactorPolicyName[]; | |
| 74 | |
| 75 // The name of the host domain policy. | |
| 76 static const char kHostDomainPolicyName[]; | |
| 77 | |
| 78 // The name of the username policy. This policy is ignored on Windows. | |
| 79 // This policy is currently considered 'internal only' and so is not | |
| 80 // documented in policy_templates.json. | |
| 81 static const char kHostMatchUsernamePolicyName[]; | |
| 82 | |
| 83 // The name of the policy that controls the host talkgadget prefix. | |
| 84 static const char kHostTalkGadgetPrefixPolicyName[]; | |
| 85 | |
| 86 // The name of the policy for requiring curtain-mode. | |
| 87 static const char kHostRequireCurtainPolicyName[]; | |
| 88 | |
| 89 // The names of the policies for token authentication URLs. | |
| 90 static const char kHostTokenUrlPolicyName[]; | |
| 91 static const char kHostTokenValidationUrlPolicyName[]; | |
| 92 static const char kHostTokenValidationCertIssuerPolicyName[]; | |
| 93 | |
| 94 // The name of the policy for disabling PIN-less authentication. | |
| 95 static const char kHostAllowClientPairing[]; | |
| 96 | |
| 97 // The name of the policy for disabling gnubbyd forwarding. | |
| 98 static const char kHostAllowGnubbyAuthPolicyName[]; | |
| 99 | |
| 100 // The name of the policy for allowing use of relay servers. | |
| 101 static const char kRelayPolicyName[]; | |
| 102 | |
| 103 // The name of the policy that restricts the range of host UDP ports. | |
| 104 static const char kUdpPortRangePolicyName[]; | |
| 105 | |
| 106 // The name of the policy for overriding policies, for use in testing. | |
| 107 static const char kHostDebugOverridePoliciesName[]; | |
| 108 | |
| 109 protected: | 69 protected: |
| 110 virtual void StartWatchingInternal() = 0; | 70 virtual void StartWatchingInternal() = 0; |
| 111 virtual void StopWatchingInternal() = 0; | 71 virtual void StopWatchingInternal() = 0; |
| 112 virtual void Reload() = 0; | 72 virtual void Reload() = 0; |
| 113 | 73 |
| 114 // Used to check if the class is on the right thread. | 74 // Used to check if the class is on the right thread. |
| 115 bool OnPolicyWatcherThread() const; | 75 bool OnPolicyWatcherThread() const; |
| 116 | 76 |
| 117 // Takes the policy dictionary from the OS specific store and extracts the | 77 // Takes the policy dictionary from the OS specific store and extracts the |
| 118 // relevant policies. | 78 // relevant policies. |
| (...skipping 29 matching lines...) Expand all Loading... |
| 148 scoped_ptr<base::DictionaryValue> bad_type_values_; | 108 scoped_ptr<base::DictionaryValue> bad_type_values_; |
| 149 | 109 |
| 150 // Allows us to cancel any inflight FileWatcher events or scheduled reloads. | 110 // Allows us to cancel any inflight FileWatcher events or scheduled reloads. |
| 151 base::WeakPtrFactory<PolicyWatcher> weak_factory_; | 111 base::WeakPtrFactory<PolicyWatcher> weak_factory_; |
| 152 }; | 112 }; |
| 153 | 113 |
| 154 } // namespace policy_hack | 114 } // namespace policy_hack |
| 155 } // namespace remoting | 115 } // namespace remoting |
| 156 | 116 |
| 157 #endif // REMOTING_HOST_POLICY_HACK_POLICY_WATCHER_H_ | 117 #endif // REMOTING_HOST_POLICY_HACK_POLICY_WATCHER_H_ |
| OLD | NEW |