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

Unified Diff: chrome/browser/policy/policy_service.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
« no previous file with comments | « chrome/browser/policy/policy_service.h ('k') | chrome/browser/policy/policy_service_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/policy/policy_service.cc
diff --git a/chrome/browser/policy/policy_service.cc b/chrome/browser/policy/policy_service.cc
deleted file mode 100644
index cd07867666285a038943885b06e6caf9ac27f3d6..0000000000000000000000000000000000000000
--- a/chrome/browser/policy/policy_service.cc
+++ /dev/null
@@ -1,42 +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/policy_service.h"
-
-#include "base/values.h"
-
-namespace policy {
-
-PolicyChangeRegistrar::PolicyChangeRegistrar(PolicyService* policy_service,
- const PolicyNamespace& ns)
- : policy_service_(policy_service),
- ns_(ns) {}
-
-PolicyChangeRegistrar::~PolicyChangeRegistrar() {
- if (!callback_map_.empty())
- policy_service_->RemoveObserver(ns_.domain, this);
-}
-
-void PolicyChangeRegistrar::Observe(const std::string& policy_name,
- const UpdateCallback& callback) {
- if (callback_map_.empty())
- policy_service_->AddObserver(ns_.domain, this);
- callback_map_[policy_name] = callback;
-}
-
-void PolicyChangeRegistrar::OnPolicyUpdated(const PolicyNamespace& ns,
- const PolicyMap& previous,
- const PolicyMap& current) {
- if (ns != ns_)
- return;
- for (CallbackMap::iterator it = callback_map_.begin();
- it != callback_map_.end(); ++it) {
- const Value* prev = previous.GetValue(it->first);
- const Value* cur = current.GetValue(it->first);
- if (!base::Value::Equals(prev, cur))
- it->second.Run(prev, cur);
- }
-}
-
-} // namespace policy
« no previous file with comments | « chrome/browser/policy/policy_service.h ('k') | chrome/browser/policy/policy_service_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698