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

Unified Diff: chrome/browser/configuration_policy_provider_win.h

Issue 2119005: [Win] Implement core mechanism to honor Windows Group Policy (Closed)
Patch Set: merge with latest Created 10 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/configuration_policy_provider_win.h
diff --git a/chrome/browser/configuration_policy_provider_win.h b/chrome/browser/configuration_policy_provider_win.h
new file mode 100755
index 0000000000000000000000000000000000000000..ccf8a247d6f27b7c1e57d6fad0bafb3e25fac110
--- /dev/null
+++ b/chrome/browser/configuration_policy_provider_win.h
@@ -0,0 +1,57 @@
+// 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_CONFIGURATION_POLICY_PROVIDER_WIN_H_
+#define CHROME_BROWSER_CONFIGURATION_POLICY_PROVIDER_WIN_H_
+
+#include "chrome/browser/configuration_policy_store.h"
+#include "chrome/browser/configuration_policy_provider.h"
+
+// An implementation of |ConfigurationPolicyProvider| using the
+// mechanism provided by Windows Groups Policy. Policy decisions are
+// stored as values in a special section of the Windows Registry.
+// On a managed machine in a domain, this portion of the registry is
+// periodically updated by the Windows Group Policy machinery to contain
+// the latest version of the policy set by administrators.
+class WinConfigurationPolicyProvider : public ConfigurationPolicyProvider {
+ public:
+ WinConfigurationPolicyProvider();
+ virtual ~WinConfigurationPolicyProvider() { }
+
+ // ConfigurationPolicyProvider method overrides:
+ virtual bool Provide(ConfigurationPolicyStore* store);
+
+ protected:
+ // The sub key path for Chromiums's Group Policy information in the
+ // Windows registry.
+ static const wchar_t kPolicyRegistrySubKey[];
+
+ // Constants specifying the names of policy-specifying registry values
+ // in |kChromiumPolicySubKey|.
+ static const wchar_t kHomepageRegistryValueName[];
+ static const wchar_t kHomepageIsNewTabPageRegistryValueName[];
+ static const wchar_t kCookiesModeRegistryValueName[];
+
+ private:
+ // For each Group Policy registry value that maps to a browser policy, there
+ // is an entry in |registry_to_policy_map_| of type |RegistryPolicyMapEntry|
+ // that specifies the registry value name and the browser policy that it
+ // maps to.
+ struct RegistryPolicyMapEntry {
+ Value::ValueType value_type;
+ ConfigurationPolicyStore::PolicyType policy_type;
+ const wchar_t* registry_value_name;
+ };
+
+ static const RegistryPolicyMapEntry registry_to_policy_map_[];
+
+ // Methods to perfrom type-specific policy lookups in the registry
+ // HKLM is checked fist, then HKLM.
+ bool GetRegistryPolicyString(const wchar_t* value_name, string16* result);
+ bool GetRegistryPolicyBoolean(const wchar_t* value_name, bool* result);
+ bool GetRegistryPolicyInteger(const wchar_t* value_name, uint32* result);
+};
+
+#endif // CHROME_BROWSER_CONFIGURATION_POLICY_PROVIDER_WIN_H_
+
« no previous file with comments | « chrome/browser/configuration_policy_provider.cc ('k') | chrome/browser/configuration_policy_provider_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698