| 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 : PolicyWatcher(task_runner), | 47 : PolicyWatcher(task_runner), |
| 48 user_policy_changed_event_(false, false), | 48 user_policy_changed_event_(false, false), |
| 49 machine_policy_changed_event_(false, false), | 49 machine_policy_changed_event_(false, false), |
| 50 user_policy_watcher_failed_(false), | 50 user_policy_watcher_failed_(false), |
| 51 machine_policy_watcher_failed_(false) { | 51 machine_policy_watcher_failed_(false) { |
| 52 } | 52 } |
| 53 | 53 |
| 54 virtual ~PolicyWatcherWin() { | 54 virtual ~PolicyWatcherWin() { |
| 55 } | 55 } |
| 56 | 56 |
| 57 virtual void StartWatchingInternal() OVERRIDE { | 57 virtual void StartWatchingInternal() override { |
| 58 DCHECK(OnPolicyWatcherThread()); | 58 DCHECK(OnPolicyWatcherThread()); |
| 59 | 59 |
| 60 if (!RegisterGPNotification(user_policy_changed_event_.handle(), false)) { | 60 if (!RegisterGPNotification(user_policy_changed_event_.handle(), false)) { |
| 61 PLOG(WARNING) << "Failed to register user group policy notification"; | 61 PLOG(WARNING) << "Failed to register user group policy notification"; |
| 62 user_policy_watcher_failed_ = true; | 62 user_policy_watcher_failed_ = true; |
| 63 } | 63 } |
| 64 | 64 |
| 65 if (!RegisterGPNotification(machine_policy_changed_event_.handle(), true)) { | 65 if (!RegisterGPNotification(machine_policy_changed_event_.handle(), true)) { |
| 66 PLOG(WARNING) << "Failed to register machine group policy notification."; | 66 PLOG(WARNING) << "Failed to register machine group policy notification."; |
| 67 machine_policy_watcher_failed_ = true; | 67 machine_policy_watcher_failed_ = true; |
| 68 } | 68 } |
| 69 | 69 |
| 70 Reload(); | 70 Reload(); |
| 71 } | 71 } |
| 72 | 72 |
| 73 virtual void StopWatchingInternal() OVERRIDE { | 73 virtual void StopWatchingInternal() override { |
| 74 DCHECK(OnPolicyWatcherThread()); | 74 DCHECK(OnPolicyWatcherThread()); |
| 75 | 75 |
| 76 if (!UnregisterGPNotification(user_policy_changed_event_.handle())) { | 76 if (!UnregisterGPNotification(user_policy_changed_event_.handle())) { |
| 77 PLOG(WARNING) << "Failed to unregister user group policy notification"; | 77 PLOG(WARNING) << "Failed to unregister user group policy notification"; |
| 78 } | 78 } |
| 79 | 79 |
| 80 if (!UnregisterGPNotification(machine_policy_changed_event_.handle())) { | 80 if (!UnregisterGPNotification(machine_policy_changed_event_.handle())) { |
| 81 PLOG(WARNING) << | 81 PLOG(WARNING) << |
| 82 "Failed to unregister machine group policy notification."; | 82 "Failed to unregister machine group policy notification."; |
| 83 } | 83 } |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 bool machine_policy_watcher_failed_; | 216 bool machine_policy_watcher_failed_; |
| 217 }; | 217 }; |
| 218 | 218 |
| 219 PolicyWatcher* PolicyWatcher::Create( | 219 PolicyWatcher* PolicyWatcher::Create( |
| 220 scoped_refptr<base::SingleThreadTaskRunner> task_runner) { | 220 scoped_refptr<base::SingleThreadTaskRunner> task_runner) { |
| 221 return new PolicyWatcherWin(task_runner); | 221 return new PolicyWatcherWin(task_runner); |
| 222 } | 222 } |
| 223 | 223 |
| 224 } // namespace policy_hack | 224 } // namespace policy_hack |
| 225 } // namespace remoting | 225 } // namespace remoting |
| OLD | NEW |