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

Unified Diff: chrome/browser/policy/configuration_policy_pref_store.h

Issue 109743002: Move policy code into components/policy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: moar fixes Created 7 years 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/policy/configuration_policy_pref_store.h
diff --git a/chrome/browser/policy/configuration_policy_pref_store.h b/chrome/browser/policy/configuration_policy_pref_store.h
deleted file mode 100644
index 73261cbebc40bb0d1d6f70092f2a1094418188ad..0000000000000000000000000000000000000000
--- a/chrome/browser/policy/configuration_policy_pref_store.h
+++ /dev/null
@@ -1,84 +0,0 @@
-// Copyright (c) 2012 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_POLICY_CONFIGURATION_POLICY_PREF_STORE_H_
-#define CHROME_BROWSER_POLICY_CONFIGURATION_POLICY_PREF_STORE_H_
-
-#include <string>
-
-#include "base/basictypes.h"
-#include "base/memory/scoped_ptr.h"
-#include "base/observer_list.h"
-#include "base/prefs/pref_store.h"
-#include "base/values.h"
-#include "chrome/browser/policy/policy_service.h"
-#include "components/policy/core/common/policy_map.h"
-#include "components/policy/core/common/policy_types.h"
-
-class PrefValueMap;
-
-namespace policy {
-
-class ConfigurationPolicyHandlerList;
-
-// An implementation of PrefStore that bridges policy settings as read from the
-// PolicyService to preferences. Converts POLICY_DOMAIN_CHROME policies a given
-// PolicyLevel to their corresponding preferences.
-class ConfigurationPolicyPrefStore
- : public PrefStore,
- public PolicyService::Observer {
- public:
- // Does not take ownership of |service| nor |handler_list|, which must outlive
- // the store. Only policies of the given |level| will be mapped.
- ConfigurationPolicyPrefStore(
- PolicyService* service,
- const ConfigurationPolicyHandlerList* handler_list,
- PolicyLevel level);
-
- // PrefStore methods:
- virtual void AddObserver(PrefStore::Observer* observer) OVERRIDE;
- virtual void RemoveObserver(PrefStore::Observer* observer) OVERRIDE;
- virtual bool HasObservers() const OVERRIDE;
- virtual bool IsInitializationComplete() const OVERRIDE;
- virtual bool GetValue(const std::string& key,
- const Value** result) const OVERRIDE;
-
- // PolicyService::Observer methods:
- virtual void OnPolicyUpdated(const PolicyNamespace& ns,
- const PolicyMap& previous,
- const PolicyMap& current) OVERRIDE;
- virtual void OnPolicyServiceInitialized(PolicyDomain domain) OVERRIDE;
-
- private:
- virtual ~ConfigurationPolicyPrefStore();
-
- // Refreshes policy information, rereading policy from the policy service and
- // sending out change notifications as appropriate.
- void Refresh();
-
- // Returns a new PrefValueMap containing the preference values that correspond
- // to the policies currently provided by the policy service.
- PrefValueMap* CreatePreferencesFromPolicies();
-
- // The PolicyService from which policy settings are read.
- PolicyService* policy_service_;
-
- // The policy handlers used to convert policies into their corresponding
- // preferences.
- const ConfigurationPolicyHandlerList* handler_list_;
-
- // The policy level that this PrefStore uses.
- PolicyLevel level_;
-
- // Current policy preferences.
- scoped_ptr<PrefValueMap> prefs_;
-
- ObserverList<PrefStore::Observer, true> observers_;
-
- DISALLOW_COPY_AND_ASSIGN(ConfigurationPolicyPrefStore);
-};
-
-} // namespace policy
-
-#endif // CHROME_BROWSER_POLICY_CONFIGURATION_POLICY_PREF_STORE_H_

Powered by Google App Engine
This is Rietveld 408576698