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

Unified Diff: chrome/browser/policy/cloud/cloud_policy_manager.h

Issue 79023002: Support cloud policy for extensions on the desktop platforms. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed stub, again Created 7 years, 1 month 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_manager.h
diff --git a/chrome/browser/policy/cloud/cloud_policy_manager.h b/chrome/browser/policy/cloud/cloud_policy_manager.h
index 8f3c9ff2e855262a5502a8c9c07474ffae234b4f..c6372d355b2f18ffefac1a2d6593bb3af105a5c2 100644
--- a/chrome/browser/policy/cloud/cloud_policy_manager.h
+++ b/chrome/browser/policy/cloud/cloud_policy_manager.h
@@ -14,12 +14,18 @@
#include "chrome/browser/policy/cloud/cloud_policy_constants.h"
#include "chrome/browser/policy/cloud/cloud_policy_core.h"
#include "chrome/browser/policy/cloud/cloud_policy_store.h"
+#include "chrome/browser/policy/cloud/component_cloud_policy_service.h"
#include "chrome/browser/policy/configuration_policy_provider.h"
namespace base {
+class FilePath;
class SequencedTaskRunner;
}
+namespace net {
+class URLRequestContextGetter;
+}
+
namespace policy {
class PolicyBundle;
bartfab (slow) 2013/11/25 15:05:50 Nit: No longer used.
Joao da Silva 2013/11/25 16:44:11 Done.
@@ -32,13 +38,19 @@ class PolicyBundle;
// functionality specific to user-level and device-level cloud policy, such as
// blocking on initial user policy fetch or device enrollment.
class CloudPolicyManager : public ConfigurationPolicyProvider,
- public CloudPolicyStore::Observer {
+ public CloudPolicyStore::Observer,
+ public ComponentCloudPolicyService::Delegate {
public:
// |task_runner| is the runner for policy refresh tasks.
+ // |file_task_runner| is used for file operations.
+ // |io_task_runner| is used for network IO.
+ // Note: currently these must be the FILE and the IO BrowserThreads.
bartfab (slow) 2013/11/25 15:05:50 Nit: "these" is ambiguous (there are three task ru
Joao da Silva 2013/11/25 16:44:11 Done.
CloudPolicyManager(
const PolicyNamespaceKey& policy_ns_key,
CloudPolicyStore* cloud_policy_store,
- const scoped_refptr<base::SequencedTaskRunner>& task_runner);
+ const scoped_refptr<base::SequencedTaskRunner>& task_runner,
+ const scoped_refptr<base::SequencedTaskRunner>& file_task_runner,
+ const scoped_refptr<base::SequencedTaskRunner>& io_task_runner);
virtual ~CloudPolicyManager();
CloudPolicyCore* core() { return &core_; }
@@ -53,14 +65,17 @@ class CloudPolicyManager : public ConfigurationPolicyProvider,
virtual void OnStoreLoaded(CloudPolicyStore* cloud_policy_store) OVERRIDE;
virtual void OnStoreError(CloudPolicyStore* cloud_policy_store) OVERRIDE;
+ // ComponentCloudPolicyService::Delegate:
+ virtual void OnComponentCloudPolicyUpdated() OVERRIDE;
+
protected:
// Check whether fully initialized and if so, publish policy by calling
// ConfigurationPolicyStore::UpdatePolicy().
void CheckAndPublishPolicy();
- // Called by CheckAndPublishPolicy() to create a bundle with the current
- // policies.
- virtual scoped_ptr<PolicyBundle> CreatePolicyBundle();
+ void CreateComponentCloudPolicyService(
+ const base::FilePath& policy_cache_path,
+ const scoped_refptr<net::URLRequestContextGetter>& request_context);
// Convenience accessors to core() components.
CloudPolicyClient* client() { return core_.client(); }
@@ -69,17 +84,24 @@ class CloudPolicyManager : public ConfigurationPolicyProvider,
const CloudPolicyStore* store() const { return core_.store(); }
CloudPolicyService* service() { return core_.service(); }
const CloudPolicyService* service() const { return core_.service(); }
+ ComponentCloudPolicyService* component_policy_service() const {
+ return component_policy_service_.get();
+ }
private:
// Completion handler for policy refresh operations.
void OnRefreshComplete(bool success);
CloudPolicyCore core_;
+ scoped_ptr<ComponentCloudPolicyService> component_policy_service_;
// Whether there's a policy refresh operation pending, in which case all
// policy update notifications are deferred until after it completes.
bool waiting_for_policy_refresh_;
+ scoped_refptr<base::SequencedTaskRunner> file_task_runner_;
+ scoped_refptr<base::SequencedTaskRunner> io_task_runner_;
+
DISALLOW_COPY_AND_ASSIGN(CloudPolicyManager);
};

Powered by Google App Engine
This is Rietveld 408576698