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

Unified Diff: chrome/browser/policy/configuration_policy_handler_list.cc

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_handler_list.cc
diff --git a/chrome/browser/policy/configuration_policy_handler_list.cc b/chrome/browser/policy/configuration_policy_handler_list.cc
deleted file mode 100644
index 25413a74aeab14054514011808187cda8793d96a..0000000000000000000000000000000000000000
--- a/chrome/browser/policy/configuration_policy_handler_list.cc
+++ /dev/null
@@ -1,59 +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.
-
-#include "chrome/browser/policy/configuration_policy_handler_list.h"
-
-#include "base/prefs/pref_value_map.h"
-#include "base/stl_util.h"
-#include "chrome/browser/policy/configuration_policy_handler.h"
-#include "components/policy/core/browser/policy_error_map.h"
-#include "components/policy/core/common/policy_map.h"
-#include "grit/component_strings.h"
-
-namespace policy {
-ConfigurationPolicyHandlerList::ConfigurationPolicyHandlerList(
- const GetChromePolicyDetailsCallback& details_callback)
- : details_callback_(details_callback) {}
-
-ConfigurationPolicyHandlerList::~ConfigurationPolicyHandlerList() {
- STLDeleteElements(&handlers_);
-}
-
-void ConfigurationPolicyHandlerList::AddHandler(
- scoped_ptr<ConfigurationPolicyHandler> handler) {
- handlers_.push_back(handler.release());
-}
-
-void ConfigurationPolicyHandlerList::ApplyPolicySettings(
- const PolicyMap& policies,
- PrefValueMap* prefs,
- PolicyErrorMap* errors) const {
- PolicyErrorMap scoped_errors;
- if (!errors)
- errors = &scoped_errors;
-
- std::vector<ConfigurationPolicyHandler*>::const_iterator handler;
- for (handler = handlers_.begin(); handler != handlers_.end(); ++handler) {
- if ((*handler)->CheckPolicySettings(policies, errors) && prefs)
- (*handler)->ApplyPolicySettings(policies, prefs);
- }
-
- for (PolicyMap::const_iterator it = policies.begin();
- it != policies.end();
- ++it) {
- const PolicyDetails* details =
- details_callback_.is_null() ? NULL : details_callback_.Run(it->first);
- if (details && details->is_deprecated)
- errors->AddError(it->first, IDS_POLICY_DEPRECATED);
- }
-}
-
-void ConfigurationPolicyHandlerList::PrepareForDisplaying(
- PolicyMap* policies) const {
- std::vector<ConfigurationPolicyHandler*>::const_iterator handler;
- for (handler = handlers_.begin(); handler != handlers_.end(); ++handler)
- (*handler)->PrepareForDisplaying(policies);
-}
-
-} // namespace policy

Powered by Google App Engine
This is Rietveld 408576698