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

Unified Diff: chrome/browser/chromeos/policy/proxy_policy_provider.cc

Issue 137203005: Moved the ProxyPolicyProvider to the policy component. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@BPC-3-dm-url-at-base
Patch Set: Created 6 years, 11 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/chromeos/policy/proxy_policy_provider.cc
diff --git a/chrome/browser/chromeos/policy/proxy_policy_provider.cc b/chrome/browser/chromeos/policy/proxy_policy_provider.cc
deleted file mode 100644
index 30c879c4b2d7b105a21b9ccc2961217bce8d7952..0000000000000000000000000000000000000000
--- a/chrome/browser/chromeos/policy/proxy_policy_provider.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/chromeos/policy/proxy_policy_provider.h"
-
-namespace policy {
-
-ProxyPolicyProvider::ProxyPolicyProvider() : delegate_(NULL) {}
-
-ProxyPolicyProvider::~ProxyPolicyProvider() {
- DCHECK(!delegate_);
-}
-
-void ProxyPolicyProvider::SetDelegate(ConfigurationPolicyProvider* delegate) {
- if (delegate_)
- delegate_->RemoveObserver(this);
- delegate_ = delegate;
- if (delegate_) {
- delegate_->AddObserver(this);
- OnUpdatePolicy(delegate_);
- } else {
- UpdatePolicy(scoped_ptr<PolicyBundle>(new PolicyBundle()));
- }
-}
-
-void ProxyPolicyProvider::Shutdown() {
- // Note: the delegate is not owned by the proxy provider, so this call is not
- // forwarded. The same applies for the Init() call.
- // Just drop the delegate without propagating updates here.
- if (delegate_) {
- delegate_->RemoveObserver(this);
- delegate_ = NULL;
- }
- ConfigurationPolicyProvider::Shutdown();
-}
-
-void ProxyPolicyProvider::RefreshPolicies() {
- if (delegate_) {
- delegate_->RefreshPolicies();
- } else {
- // Subtle: if a RefreshPolicies() call comes after Shutdown() then the
- // current bundle should be served instead. This also does the right thing
- // if SetDelegate() was never called before.
- scoped_ptr<PolicyBundle> bundle(new PolicyBundle());
- bundle->CopyFrom(policies());
- UpdatePolicy(bundle.Pass());
- }
-}
-
-void ProxyPolicyProvider::OnUpdatePolicy(
- ConfigurationPolicyProvider* provider) {
- DCHECK_EQ(delegate_, provider);
- scoped_ptr<PolicyBundle> bundle(new PolicyBundle());
- bundle->CopyFrom(delegate_->policies());
- UpdatePolicy(bundle.Pass());
-}
-
-} // namespace policy

Powered by Google App Engine
This is Rietveld 408576698