| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_POLICY_POLICY_LOADER_WIN_H_ |
| 6 #define CHROME_BROWSER_POLICY_POLICY_LOADER_WIN_H_ |
| 7 #pragma once |
| 8 |
| 9 #include "base/synchronization/waitable_event.h" |
| 10 #include "base/win/object_watcher.h" |
| 11 #include "chrome/browser/policy/async_policy_loader.h" |
| 12 |
| 13 namespace policy { |
| 14 |
| 15 struct PolicyDefinitionList; |
| 16 |
| 17 // Loads policies from the Windows registry, and watches for Group Policy |
| 18 // notifications to trigger reloads. |
| 19 class PolicyLoaderWin : public AsyncPolicyLoader, |
| 20 public base::win::ObjectWatcher::Delegate { |
| 21 public: |
| 22 explicit PolicyLoaderWin(const PolicyDefinitionList* policy_list); |
| 23 virtual ~PolicyLoaderWin(); |
| 24 |
| 25 // AsyncPolicyLoader implementation. |
| 26 virtual void InitOnFile() OVERRIDE; |
| 27 virtual scoped_ptr<PolicyBundle> Load() OVERRIDE; |
| 28 |
| 29 private: |
| 30 // Installs the watchers for the Group Policy update events. |
| 31 void SetupWatches(); |
| 32 |
| 33 // ObjectWatcher::Delegate overrides: |
| 34 virtual void OnObjectSignaled(HANDLE object) OVERRIDE; |
| 35 |
| 36 bool is_initialized_; |
| 37 const PolicyDefinitionList* policy_list_; |
| 38 |
| 39 base::WaitableEvent user_policy_changed_event_; |
| 40 base::WaitableEvent machine_policy_changed_event_; |
| 41 base::win::ObjectWatcher user_policy_watcher_; |
| 42 base::win::ObjectWatcher machine_policy_watcher_; |
| 43 bool user_policy_watcher_failed_; |
| 44 bool machine_policy_watcher_failed_; |
| 45 |
| 46 DISALLOW_COPY_AND_ASSIGN(PolicyLoaderWin); |
| 47 }; |
| 48 |
| 49 } // namespace policy |
| 50 |
| 51 #endif // CHROME_BROWSER_POLICY_POLICY_LOADER_WIN_H_ |
| OLD | NEW |