Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(490)

Side by Side Diff: chrome/browser/policy/configuration_policy_loader_win.h

Issue 6091002: Refactor the windows policy provider to use AsynchronousPolicyProvider. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix windows tests Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2010 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_CONFIGURATION_POLICY_LOADER_WIN_H_
6 #define CHROME_BROWSER_POLICY_CONFIGURATION_POLICY_LOADER_WIN_H_
7 #pragma once
8
9 #include "base/object_watcher.h"
10 #include "base/waitable_event.h"
11 #include "chrome/browser/policy/asynchronous_policy_loader.h"
12
13 namespace policy {
14
15 // Keeps watch on Windows Group Policy notification event to trigger a policy
16 // reload when Group Policy changes.
17 class ConfigurationPolicyLoaderWin
18 : public AsynchronousPolicyLoader,
19 public base::ObjectWatcher::Delegate,
20 public MessageLoop::DestructionObserver {
21 public:
22 ConfigurationPolicyLoaderWin(
23 AsynchronousPolicyProvider::Delegate* delegate,
24 int reload_interval_minutes);
25 virtual ~ConfigurationPolicyLoaderWin() {}
26
27 protected:
28 // AsynchronousPolicyLoader overrides:
29 virtual void InitOnFileThread();
30 virtual void StopOnFileThread();
31
32 private:
33 // Updates the watchers and schedules the reload task if appropriate.
34 void SetupWatches();
35
36 // Post a reload notification and update the watch machinery.
37 void Reload();
38
39 // ObjectWatcher::Delegate overrides:
40 virtual void OnObjectSignaled(HANDLE object);
41
42 // MessageLoop::DestructionObserver overrides:
43 virtual void WillDestroyCurrentMessageLoop();
44
45 base::WaitableEvent user_policy_changed_event_;
46 base::WaitableEvent machine_policy_changed_event_;
47 base::ObjectWatcher user_policy_watcher_;
48 base::ObjectWatcher machine_policy_watcher_;
49 bool user_policy_watcher_failed_;
50 bool machine_policy_watcher_failed_;
51
52 DISALLOW_COPY_AND_ASSIGN(ConfigurationPolicyLoaderWin);
53 };
54
55 } // namespace policy
56
57 #endif // CHROME_BROWSER_POLICY_CONFIGURATION_POLICY_LOADER_WIN_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698