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

Unified Diff: chrome/browser/configuration_policy_provider_win.h

Issue 2858060: Changing policy while Chrome is running should refresh preferences without relaunching (Closed)
Patch Set: changed name of mock Created 10 years, 4 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
index 874a9ccca5b74a01d5da003eb35064a688f0515c..522b53883fc77fcb7d97d060a0484f5b43e764d3 100644
--- a/chrome/browser/configuration_policy_provider_win.h
+++ b/chrome/browser/configuration_policy_provider_win.h
@@ -6,6 +6,9 @@
#define CHROME_BROWSER_CONFIGURATION_POLICY_PROVIDER_WIN_H_
#pragma once
+#include "base/object_watcher.h"
+#include "base/scoped_ptr.h"
+#include "base/waitable_event.h"
#include "chrome/browser/configuration_policy_store.h"
#include "chrome/browser/configuration_policy_provider.h"
@@ -17,6 +20,23 @@
// the latest version of the policy set by administrators.
class ConfigurationPolicyProviderWin : public ConfigurationPolicyProvider {
public:
+ // Keeps watch on Windows Group Policy notification event to trigger
+ // a policy reload when Group Policy changes.
+ class GroupPolicyChangeWatcher : public base::ObjectWatcher::Delegate {
+ public:
+ explicit GroupPolicyChangeWatcher(ConfigurationPolicyProvider* provider);
+ virtual ~GroupPolicyChangeWatcher() {}
+
+ virtual void OnObjectSignaled(HANDLE object);
+
+ private:
+ ConfigurationPolicyProvider* provider_;
+ base::WaitableEvent user_policy_changed_event_;
+ base::WaitableEvent machine_policy_changed_event_;
+ base::ObjectWatcher user_policy_watcher_;
+ base::ObjectWatcher machine_policy_watcher_;
+ };
+
ConfigurationPolicyProviderWin();
virtual ~ConfigurationPolicyProviderWin() { }
@@ -29,6 +49,8 @@ class ConfigurationPolicyProviderWin : public ConfigurationPolicyProvider {
static const wchar_t kPolicyRegistrySubKey[];
private:
+ scoped_ptr<GroupPolicyChangeWatcher> watcher_;
+
// Methods to perfrom type-specific policy lookups in the registry.
// HKLM is checked first, then HKCU.
bool GetRegistryPolicyString(const wchar_t* value_name, string16* result);
« 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