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

Unified Diff: chrome/browser/policy/cloud/cloud_policy_core.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/cloud/cloud_policy_core.h
diff --git a/chrome/browser/policy/cloud/cloud_policy_core.h b/chrome/browser/policy/cloud/cloud_policy_core.h
deleted file mode 100644
index 48ca11eb223ae81bb605a447203647fc52dbf5c0..0000000000000000000000000000000000000000
--- a/chrome/browser/policy/cloud/cloud_policy_core.h
+++ /dev/null
@@ -1,117 +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_CLOUD_CLOUD_POLICY_CORE_H_
-#define CHROME_BROWSER_POLICY_CLOUD_CLOUD_POLICY_CORE_H_
-
-#include <string>
-
-#include "base/basictypes.h"
-#include "base/memory/ref_counted.h"
-#include "base/memory/scoped_ptr.h"
-#include "base/observer_list.h"
-#include "base/prefs/pref_member.h"
-#include "chrome/browser/policy/cloud/cloud_policy_constants.h"
-
-class PrefService;
-
-namespace base {
-class SequencedTaskRunner;
-}
-
-namespace policy {
-
-class CloudPolicyClient;
-class CloudPolicyRefreshScheduler;
-class CloudPolicyService;
-class CloudPolicyStore;
-
-// CloudPolicyCore glues together the ingredients that are essential for
-// obtaining a fully-functional cloud policy system: CloudPolicyClient and
-// CloudPolicyStore, which are responsible for fetching policy from the cloud
-// and storing it locally, respectively, as well as a CloudPolicyService
-// instance that moves data between the two former components, and
-// CloudPolicyRefreshScheduler which triggers periodic refreshes.
-class CloudPolicyCore {
- public:
- // Callbacks for policy core events.
- class Observer {
- public:
- virtual ~Observer();
-
- // Called after the core is connected.
- virtual void OnCoreConnected(CloudPolicyCore* core) = 0;
-
- // Called after the refresh scheduler is started.
- virtual void OnRefreshSchedulerStarted(CloudPolicyCore* core) = 0;
-
- // Called before the core is disconnected.
- virtual void OnCoreDisconnecting(CloudPolicyCore* core) = 0;
- };
-
- // |task_runner| is the runner for policy refresh tasks.
- CloudPolicyCore(const PolicyNamespaceKey& policy_ns_key,
- CloudPolicyStore* store,
- const scoped_refptr<base::SequencedTaskRunner>& task_runner);
- ~CloudPolicyCore();
-
- CloudPolicyClient* client() { return client_.get(); }
- const CloudPolicyClient* client() const { return client_.get(); }
-
- CloudPolicyStore* store() { return store_; }
- const CloudPolicyStore* store() const { return store_; }
-
- CloudPolicyService* service() { return service_.get(); }
- const CloudPolicyService* service() const { return service_.get(); }
-
- CloudPolicyRefreshScheduler* refresh_scheduler() {
- return refresh_scheduler_.get();
- }
- const CloudPolicyRefreshScheduler* refresh_scheduler() const {
- return refresh_scheduler_.get();
- }
-
- // Initializes the cloud connection.
- void Connect(scoped_ptr<CloudPolicyClient> client);
-
- // Shuts down the cloud connection.
- void Disconnect();
-
- // Requests a policy refresh to be performed soon. This may apply throttling,
- // and the request may not be immediately sent.
- void RefreshSoon();
-
- // Starts a refresh scheduler in case none is running yet.
- void StartRefreshScheduler();
-
- // Watches the pref named |refresh_pref_name| in |pref_service| and adjusts
- // |refresh_scheduler_|'s refresh delay accordingly.
- void TrackRefreshDelayPref(PrefService* pref_service,
- const std::string& refresh_pref_name);
-
- // Registers an observer to be notified of policy core events.
- void AddObserver(Observer* observer);
-
- // Removes the specified observer.
- void RemoveObserver(Observer* observer);
-
- private:
- // Updates the refresh scheduler on refresh delay changes.
- void UpdateRefreshDelayFromPref();
-
- PolicyNamespaceKey policy_ns_key_;
- CloudPolicyStore* store_;
- scoped_refptr<base::SequencedTaskRunner> task_runner_;
- scoped_ptr<CloudPolicyClient> client_;
- scoped_ptr<CloudPolicyService> service_;
- scoped_ptr<CloudPolicyRefreshScheduler> refresh_scheduler_;
- scoped_ptr<IntegerPrefMember> refresh_delay_;
- ObserverList<Observer, true> observers_;
-
- DISALLOW_COPY_AND_ASSIGN(CloudPolicyCore);
-};
-
-} // namespace policy
-
-#endif // CHROME_BROWSER_POLICY_CLOUD_CLOUD_POLICY_CORE_H_
« no previous file with comments | « chrome/browser/policy/cloud/cloud_policy_constants.cc ('k') | chrome/browser/policy/cloud/cloud_policy_core.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698