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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 virtual void StopWatching(base::WaitableEvent* done); | 42 virtual void StopWatching(base::WaitableEvent* done); |
43 | 43 |
44 // Implemented by each platform. This message loop should be an IO message | 44 // Implemented by each platform. This message loop should be an IO message |
45 // loop. | 45 // loop. |
46 static PolicyWatcher* Create( | 46 static PolicyWatcher* Create( |
47 scoped_refptr<base::SingleThreadTaskRunner> task_runner); | 47 scoped_refptr<base::SingleThreadTaskRunner> task_runner); |
48 | 48 |
49 // The name of the NAT traversal policy. | 49 // The name of the NAT traversal policy. |
50 static const char kNatPolicyName[]; | 50 static const char kNatPolicyName[]; |
51 | 51 |
| 52 // The name of the policy for requiring 2-factor authentication. |
| 53 static const char kRequireTwoFactorPolicyName[]; |
| 54 |
52 // The name of the host domain policy. | 55 // The name of the host domain policy. |
53 static const char kHostDomainPolicyName[]; | 56 static const char kHostDomainPolicyName[]; |
54 | 57 |
| 58 // The name of the talkgadget policy. |
| 59 static const char kTalkGadgetPolicyName[]; |
| 60 |
55 protected: | 61 protected: |
56 virtual void StartWatchingInternal() = 0; | 62 virtual void StartWatchingInternal() = 0; |
57 virtual void StopWatchingInternal() = 0; | 63 virtual void StopWatchingInternal() = 0; |
58 virtual void Reload() = 0; | 64 virtual void Reload() = 0; |
59 | 65 |
60 // Used to check if the class is on the right thread. | 66 // Used to check if the class is on the right thread. |
61 bool OnPolicyWatcherThread() const; | 67 bool OnPolicyWatcherThread() const; |
62 | 68 |
63 // Takes the policy dictionary from the OS specific store and extracts the | 69 // Takes the policy dictionary from the OS specific store and extracts the |
64 // relevant policies. | 70 // relevant policies. |
(...skipping 20 matching lines...) Expand all Loading... |
85 scoped_ptr<base::DictionaryValue> old_policies_; | 91 scoped_ptr<base::DictionaryValue> old_policies_; |
86 | 92 |
87 // Allows us to cancel any inflight FileWatcher events or scheduled reloads. | 93 // Allows us to cancel any inflight FileWatcher events or scheduled reloads. |
88 base::WeakPtrFactory<PolicyWatcher> weak_factory_; | 94 base::WeakPtrFactory<PolicyWatcher> weak_factory_; |
89 }; | 95 }; |
90 | 96 |
91 } // namespace policy_hack | 97 } // namespace policy_hack |
92 } // namespace remoting | 98 } // namespace remoting |
93 | 99 |
94 #endif // REMOTING_HOST_POLICY_HACK_POLICY_WATCHER_H_ | 100 #endif // REMOTING_HOST_POLICY_HACK_POLICY_WATCHER_H_ |
OLD | NEW |