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 #ifndef COMPONENTS_POLICY_CORE_COMMON_POLICY_LOADER_WIN_H_ | 5 #ifndef COMPONENTS_POLICY_CORE_COMMON_POLICY_LOADER_WIN_H_ |
6 #define COMPONENTS_POLICY_CORE_COMMON_POLICY_LOADER_WIN_H_ | 6 #define COMPONENTS_POLICY_CORE_COMMON_POLICY_LOADER_WIN_H_ |
7 | 7 |
8 #include <windows.h> | 8 #include <windows.h> |
9 #include <userenv.h> | 9 #include <userenv.h> |
10 | 10 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 const base::string16& chrome_policy_key, | 55 const base::string16& chrome_policy_key, |
56 AppliedGPOListProvider* gpo_provider); | 56 AppliedGPOListProvider* gpo_provider); |
57 virtual ~PolicyLoaderWin(); | 57 virtual ~PolicyLoaderWin(); |
58 | 58 |
59 // Creates a policy loader that uses the Win API to access GPO. | 59 // Creates a policy loader that uses the Win API to access GPO. |
60 static scoped_ptr<PolicyLoaderWin> Create( | 60 static scoped_ptr<PolicyLoaderWin> Create( |
61 scoped_refptr<base::SequencedTaskRunner> task_runner, | 61 scoped_refptr<base::SequencedTaskRunner> task_runner, |
62 const base::string16& chrome_policy_key); | 62 const base::string16& chrome_policy_key); |
63 | 63 |
64 // AsyncPolicyLoader implementation. | 64 // AsyncPolicyLoader implementation. |
65 virtual void InitOnBackgroundThread() OVERRIDE; | 65 virtual void InitOnBackgroundThread() override; |
66 virtual scoped_ptr<PolicyBundle> Load() OVERRIDE; | 66 virtual scoped_ptr<PolicyBundle> Load() override; |
67 | 67 |
68 private: | 68 private: |
69 // Reads Chrome Policy from a PReg file at the given path and stores the | 69 // Reads Chrome Policy from a PReg file at the given path and stores the |
70 // result in |policy|. | 70 // result in |policy|. |
71 bool ReadPRegFile(const base::FilePath& preg_file, | 71 bool ReadPRegFile(const base::FilePath& preg_file, |
72 RegistryDict* policy, | 72 RegistryDict* policy, |
73 PolicyLoadStatusSample *status); | 73 PolicyLoadStatusSample *status); |
74 | 74 |
75 // Loads and parses GPO policy in |policy_object_list| for scope |scope|. If | 75 // Loads and parses GPO policy in |policy_object_list| for scope |scope|. If |
76 // successful, stores the result in |policy| and returns true. Returns false | 76 // successful, stores the result in |policy| and returns true. Returns false |
(...skipping 20 matching lines...) Expand all Loading... |
97 | 97 |
98 // Loads 3rd-party policy from |gpo_dict| and merges it into |bundle|. | 98 // Loads 3rd-party policy from |gpo_dict| and merges it into |bundle|. |
99 void Load3rdPartyPolicy(const RegistryDict* gpo_dict, | 99 void Load3rdPartyPolicy(const RegistryDict* gpo_dict, |
100 PolicyScope scope, | 100 PolicyScope scope, |
101 PolicyBundle* bundle); | 101 PolicyBundle* bundle); |
102 | 102 |
103 // Installs the watchers for the Group Policy update events. | 103 // Installs the watchers for the Group Policy update events. |
104 void SetupWatches(); | 104 void SetupWatches(); |
105 | 105 |
106 // ObjectWatcher::Delegate overrides: | 106 // ObjectWatcher::Delegate overrides: |
107 virtual void OnObjectSignaled(HANDLE object) OVERRIDE; | 107 virtual void OnObjectSignaled(HANDLE object) override; |
108 | 108 |
109 bool is_initialized_; | 109 bool is_initialized_; |
110 const base::string16 chrome_policy_key_; | 110 const base::string16 chrome_policy_key_; |
111 class AppliedGPOListProvider* gpo_provider_; | 111 class AppliedGPOListProvider* gpo_provider_; |
112 | 112 |
113 base::WaitableEvent user_policy_changed_event_; | 113 base::WaitableEvent user_policy_changed_event_; |
114 base::WaitableEvent machine_policy_changed_event_; | 114 base::WaitableEvent machine_policy_changed_event_; |
115 base::win::ObjectWatcher user_policy_watcher_; | 115 base::win::ObjectWatcher user_policy_watcher_; |
116 base::win::ObjectWatcher machine_policy_watcher_; | 116 base::win::ObjectWatcher machine_policy_watcher_; |
117 bool user_policy_watcher_failed_; | 117 bool user_policy_watcher_failed_; |
118 bool machine_policy_watcher_failed_; | 118 bool machine_policy_watcher_failed_; |
119 | 119 |
120 DISALLOW_COPY_AND_ASSIGN(PolicyLoaderWin); | 120 DISALLOW_COPY_AND_ASSIGN(PolicyLoaderWin); |
121 }; | 121 }; |
122 | 122 |
123 } // namespace policy | 123 } // namespace policy |
124 | 124 |
125 #endif // COMPONENTS_POLICY_CORE_COMMON_POLICY_LOADER_WIN_H_ | 125 #endif // COMPONENTS_POLICY_CORE_COMMON_POLICY_LOADER_WIN_H_ |
OLD | NEW |