Chromium Code Reviews| Index: remoting/host/plugin/policy_hack/nat_policy_win.cc |
| diff --git a/remoting/host/plugin/policy_hack/nat_policy_win.cc b/remoting/host/plugin/policy_hack/nat_policy_win.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..4b95026e902ef1d9616b1ceadd7c900fbb94a582 |
| --- /dev/null |
| +++ b/remoting/host/plugin/policy_hack/nat_policy_win.cc |
| @@ -0,0 +1,39 @@ |
| +// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "base/compiler_specific.h" |
| +#include "base/synchronization/waitable_event.h" |
| +#include "remoting/host/plugin/policy_hack/nat_policy.h" |
|
dmac
2011/08/11 18:42:55
should this include be first?
(same for other pla
awong
2011/08/11 19:04:07
Done.
|
| + |
| +namespace remoting { |
| +namespace policy_hack { |
| + |
| +class NatPolicyWin : public NatPolicy { |
| + public: |
| + NatPolicyWin(const NatPolicy::NatEnabledCallback& nat_enabled_cb) |
| + : nat_enabled_cb_(nat_enabled_cb) { |
| + } |
| + |
| + virtual ~NatPolicyWin() { |
| + } |
| + |
| + virtual void StartWatching() OVERRIDE { |
| + nat_enabled_cb_.Run(false); |
| + } |
| + |
| + virtual void StopWatching(base::WaitableEvent* done) OVERRIDE { |
| + done->Signal(); |
| + } |
| + |
| + private: |
| + NatEnabledCallback nat_enabled_cb_; |
| +}; |
| + |
| +NatPolicy* NatPolicy::Create(MessageLoop* message_loop, |
| + const NatEnabledCallback& nat_enabled_cb) { |
| + return new NatPolicyWin(nat_enabled_cb); |
| +} |
| + |
| +} // namespace policy_hack |
| +} // namespace remoting |