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

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

Issue 5174006: Move DeviceManagementPolicyProvider into the profile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address feedback. 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..d73afc52ee1823a8e2779eb14ad91f1cf2b31bb9 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,18 +59,9 @@ 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;
@@ -102,6 +98,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_;

Powered by Google App Engine
This is Rietveld 408576698