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

Unified Diff: chrome/browser/policy/device_management_policy_provider.h

Issue 5178005: Rework the device management backend implementation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 10 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/device_management_policy_provider.h
diff --git a/chrome/browser/policy/device_management_policy_provider.h b/chrome/browser/policy/device_management_policy_provider.h
index 73a12572915ed67821311ab4d47045f133b99998..d91e22bbd8fcf98d130dfc01dbd88b15db42fa7e 100644
--- a/chrome/browser/policy/device_management_policy_provider.h
+++ b/chrome/browser/policy/device_management_policy_provider.h
@@ -18,6 +18,8 @@
#include "chrome/common/notification_registrar.h"
#include "chrome/common/notification_source.h"
+class TokenService;
+
namespace policy {
class DeviceManagementBackend;
@@ -33,8 +35,11 @@ class DeviceManagementPolicyProvider
public DeviceManagementBackend::DevicePolicyResponseDelegate,
public base::SupportsWeakPtr<DeviceManagementPolicyProvider> {
public:
- explicit DeviceManagementPolicyProvider(
- const PolicyDefinitionList* policy_list);
+ DeviceManagementPolicyProvider(const PolicyDefinitionList* policy_list,
+ DeviceManagementBackend* backend,
+ TokenService* token_service,
+ const FilePath& storage_dir);
+
virtual ~DeviceManagementPolicyProvider();
// ConfigurationPolicyProvider implementation:
@@ -54,26 +59,13 @@ class DeviceManagementPolicyProvider
// server and no response or error has yet been received.
bool IsPolicyRequestPending() const { return policy_request_pending_; }
- protected:
- friend class DeviceManagementPolicyProviderTest;
-
- // Called only by unit tests, this constructor allows the caller to specify in
- // |backend| the device management backend to which policy requests are
- // sent. The provider takes over ownership of |backend|. The directory
- // specified in |storage_dir| is used to store the device token and persisted
- // policy, rather than the user's data directory.
- DeviceManagementPolicyProvider(
- const PolicyDefinitionList* policy_list,
- DeviceManagementBackend* backend,
- const FilePath& storage_dir);
+ // Tells the provider that the passed in token service reference is about to
+ // become invalid.
+ void Shutdown();
private:
class InitializeAfterIOThreadExistsTask;
- // Returns the device management backend to use for backend requests, lazily
- // creating a new one if one doesn't already exist.
- DeviceManagementBackend* GetBackend();
-
// Called by constructors to perform shared initialization. Initialization
// requiring the IOThread must not be performed directly in this method,
// rather must be deferred until the IOThread is fully initialized. This is
@@ -102,6 +94,7 @@ class DeviceManagementPolicyProvider
const FilePath& user_data_dir);
scoped_ptr<DeviceManagementBackend> backend_;
+ TokenService* token_service_; // weak
scoped_ptr<DeviceManagementPolicyCache> cache_;
scoped_refptr<DeviceTokenFetcher> token_fetcher_;
NotificationRegistrar registrar_;
« no previous file with comments | « chrome/browser/policy/device_management_backend_impl.cc ('k') | chrome/browser/policy/device_management_policy_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698