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

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

Issue 10491013: Implement the windows policy provider based on the AsyncPolicyLoader. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Addressed comment Created 8 years, 6 months 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
OLDNEW
(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_
OLDNEW
« no previous file with comments | « chrome/browser/policy/configuration_policy_provider_win.cc ('k') | chrome/browser/policy/policy_loader_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698