| 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 various classes in | 5 // Most of this code is copied from various classes in |
| 6 // src/chrome/browser/policy. In particular, look at | 6 // src/chrome/browser/policy. In particular, look at |
| 7 // | 7 // |
| 8 // configuration_policy_provider_delegate_win.{h,cc} | 8 // configuration_policy_provider_delegate_win.{h,cc} |
| 9 // configuration_policy_loader_win.{h,cc} | 9 // configuration_policy_loader_win.{h,cc} |
| 10 // | 10 // |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 namespace { | 35 namespace { |
| 36 | 36 |
| 37 const wchar_t kRegistrySubKey[] = L"SOFTWARE\\Policies\\Google\\Chrome"; | 37 const wchar_t kRegistrySubKey[] = L"SOFTWARE\\Policies\\Google\\Chrome"; |
| 38 | 38 |
| 39 } // namespace | 39 } // namespace |
| 40 | 40 |
| 41 class NatPolicyWin : | 41 class NatPolicyWin : |
| 42 public NatPolicy, | 42 public NatPolicy, |
| 43 public base::win::ObjectWatcher::Delegate { | 43 public base::win::ObjectWatcher::Delegate { |
| 44 public: | 44 public: |
| 45 explicit NatPolicyWin(base::MessageLoopProxy* message_loop_proxy) | 45 explicit NatPolicyWin(scoped_refptr<base::SingleThreadTaskRunner> task_runner) |
| 46 : NatPolicy(message_loop_proxy), | 46 : NatPolicy(task_runner), |
| 47 user_policy_changed_event_(false, false), | 47 user_policy_changed_event_(false, false), |
| 48 machine_policy_changed_event_(false, false), | 48 machine_policy_changed_event_(false, false), |
| 49 user_policy_watcher_failed_(false), | 49 user_policy_watcher_failed_(false), |
| 50 machine_policy_watcher_failed_(false) { | 50 machine_policy_watcher_failed_(false) { |
| 51 } | 51 } |
| 52 | 52 |
| 53 virtual ~NatPolicyWin() { | 53 virtual ~NatPolicyWin() { |
| 54 } | 54 } |
| 55 | 55 |
| 56 virtual void StartWatchingInternal() OVERRIDE { | 56 virtual void StartWatchingInternal() OVERRIDE { |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 } | 170 } |
| 171 | 171 |
| 172 base::WaitableEvent user_policy_changed_event_; | 172 base::WaitableEvent user_policy_changed_event_; |
| 173 base::WaitableEvent machine_policy_changed_event_; | 173 base::WaitableEvent machine_policy_changed_event_; |
| 174 base::win::ObjectWatcher user_policy_watcher_; | 174 base::win::ObjectWatcher user_policy_watcher_; |
| 175 base::win::ObjectWatcher machine_policy_watcher_; | 175 base::win::ObjectWatcher machine_policy_watcher_; |
| 176 bool user_policy_watcher_failed_; | 176 bool user_policy_watcher_failed_; |
| 177 bool machine_policy_watcher_failed_; | 177 bool machine_policy_watcher_failed_; |
| 178 }; | 178 }; |
| 179 | 179 |
| 180 NatPolicy* NatPolicy::Create(base::MessageLoopProxy* message_loop_proxy) { | 180 NatPolicy* NatPolicy::Create( |
| 181 return new NatPolicyWin(message_loop_proxy); | 181 scoped_refptr<base::SingleThreadTaskRunner> task_runner) { |
| 182 return new NatPolicyWin(task_runner); |
| 182 } | 183 } |
| 183 | 184 |
| 184 } // namespace policy_hack | 185 } // namespace policy_hack |
| 185 } // namespace remoting | 186 } // namespace remoting |
| OLD | NEW |