| 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 | 44 |
| 45 // Loads policies from the Windows registry, and watches for Group Policy | 45 // Loads policies from the Windows registry, and watches for Group Policy |
| 46 // notifications to trigger reloads. | 46 // notifications to trigger reloads. |
| 47 class POLICY_EXPORT PolicyLoaderWin | 47 class POLICY_EXPORT PolicyLoaderWin |
| 48 : public AsyncPolicyLoader, | 48 : public AsyncPolicyLoader, |
| 49 public base::win::ObjectWatcher::Delegate { | 49 public base::win::ObjectWatcher::Delegate { |
| 50 public: | 50 public: |
| 51 // The PReg file name used by GPO. | 51 // The PReg file name used by GPO. |
| 52 static const base::FilePath::CharType kPRegFileName[]; | 52 static const base::FilePath::CharType kPRegFileName[]; |
| 53 | 53 |
| 54 // Passing |gpo_provider| equal nullptr forces all reads to go through the |
| 55 // registry. This is undesirable for Chrome (see crbug.com/259236), but |
| 56 // needed for some other use cases (i.e. Chromoting - see crbug.com/460734). |
| 54 PolicyLoaderWin(scoped_refptr<base::SequencedTaskRunner> task_runner, | 57 PolicyLoaderWin(scoped_refptr<base::SequencedTaskRunner> task_runner, |
| 55 const base::string16& chrome_policy_key, | 58 const base::string16& chrome_policy_key, |
| 56 AppliedGPOListProvider* gpo_provider); | 59 AppliedGPOListProvider* gpo_provider); |
| 57 virtual ~PolicyLoaderWin(); | 60 virtual ~PolicyLoaderWin(); |
| 58 | 61 |
| 59 // Creates a policy loader that uses the Win API to access GPO. | 62 // Creates a policy loader that uses the Win API to access GPO. |
| 60 static scoped_ptr<PolicyLoaderWin> Create( | 63 static scoped_ptr<PolicyLoaderWin> Create( |
| 61 scoped_refptr<base::SequencedTaskRunner> task_runner, | 64 scoped_refptr<base::SequencedTaskRunner> task_runner, |
| 62 const base::string16& chrome_policy_key); | 65 const base::string16& chrome_policy_key); |
| 63 | 66 |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 base::win::ObjectWatcher machine_policy_watcher_; | 119 base::win::ObjectWatcher machine_policy_watcher_; |
| 117 bool user_policy_watcher_failed_; | 120 bool user_policy_watcher_failed_; |
| 118 bool machine_policy_watcher_failed_; | 121 bool machine_policy_watcher_failed_; |
| 119 | 122 |
| 120 DISALLOW_COPY_AND_ASSIGN(PolicyLoaderWin); | 123 DISALLOW_COPY_AND_ASSIGN(PolicyLoaderWin); |
| 121 }; | 124 }; |
| 122 | 125 |
| 123 } // namespace policy | 126 } // namespace policy |
| 124 | 127 |
| 125 #endif // COMPONENTS_POLICY_CORE_COMMON_POLICY_LOADER_WIN_H_ | 128 #endif // COMPONENTS_POLICY_CORE_COMMON_POLICY_LOADER_WIN_H_ |
| OLD | NEW |