Chromium Code Reviews| Index: chrome/browser/policy/configuration_policy_loader_win.h |
| diff --git a/chrome/browser/policy/configuration_policy_loader_win.h b/chrome/browser/policy/configuration_policy_loader_win.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..45e8958b2de032db33bc8149da0179f9aca01e4e |
| --- /dev/null |
| +++ b/chrome/browser/policy/configuration_policy_loader_win.h |
| @@ -0,0 +1,55 @@ |
| +// Copyright (c) 2010 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. |
| + |
| +#ifndef CHROME_BROWSER_POLICY_CONFIGURATION_POLICY_LOADER_WIN_H_ |
| +#define CHROME_BROWSER_POLICY_CONFIGURATION_POLICY_LOADER_WIN_H_ |
| +#pragma once |
| + |
| +#include "base/object_watcher.h" |
| +#include "base/waitable_event.h" |
| +#include "chrome/browser/policy/asynchronous_policy_loader.h" |
| + |
| +namespace policy { |
| + |
| +// Keeps watch on Windows Group Policy notification event to trigger a policy |
| +// reload when Group Policy changes. |
| +class ConfigurationPolicyLoaderWin |
| + : public AsynchronousPolicyLoader, |
| + public base::ObjectWatcher::Delegate, |
| + public MessageLoop::DestructionObserver { |
| + public: |
| + ConfigurationPolicyLoaderWin( |
| + AsynchronousPolicyProvider::Delegate* delegate, |
| + int reload_interval_minutes); |
| + virtual ~ConfigurationPolicyLoaderWin() {} |
| + |
| + protected: |
| + // AsynchronousPolicyLoader overrides: |
| + virtual void InitOnFileThread(); |
| + virtual void StopOnFileThread(); |
| + |
| + private: |
| + // Updates the watchers and schedules the reload task if appropriate. |
| + void SetupWatches(); |
| + |
| + // Post a reload notification and update the watch machinery. |
| + void Reload(); |
| + |
| + // ObjectWatcher::Delegate overrides: |
| + virtual void OnObjectSignaled(HANDLE object); |
| + |
| + // MessageLoop::DestructionObserver overrides: |
| + virtual void WillDestroyCurrentMessageLoop(); |
| + |
| + base::WaitableEvent user_policy_changed_event_; |
| + base::WaitableEvent machine_policy_changed_event_; |
| + base::ObjectWatcher user_policy_watcher_; |
| + base::ObjectWatcher machine_policy_watcher_; |
| + bool user_policy_watcher_failed_; |
| + bool machine_policy_watcher_failed_; |
|
Mattias Nissler (ping if slow)
2010/12/22 08:45:53
DISALLOW_COPY_AND_ASSIGN
danno
2010/12/22 11:02:17
Done.
|
| +}; |
| + |
| +} // namespace policy |
| + |
| +#endif // CHROME_BROWSER_POLICY_CONFIGURATION_POLICY_LOADER_WIN_H_ |