| Index: chrome/browser/policy/device_token_fetcher.h
|
| diff --git a/chrome/browser/policy/device_token_fetcher.h b/chrome/browser/policy/device_token_fetcher.h
|
| index 398ddfe33b067e0c39927d3f6ed22680cb704ef8..cb80a882e1a1ef1796a8cc116555c88503194036 100644
|
| --- a/chrome/browser/policy/device_token_fetcher.h
|
| +++ b/chrome/browser/policy/device_token_fetcher.h
|
| @@ -6,15 +6,20 @@
|
| #define CHROME_BROWSER_POLICY_DEVICE_TOKEN_FETCHER_H_
|
| #pragma once
|
|
|
| +#include "base/basictypes.h"
|
| #include "base/memory/scoped_ptr.h"
|
| -#include "chrome/browser/policy/device_management_backend.h"
|
| -#include "chrome/browser/policy/proto/device_management_backend.pb.h"
|
| +#include "chrome/browser/policy/cloud_policy_constants.h"
|
| +
|
| +namespace enterprise_management {
|
| +class DeviceManagementResponse;
|
| +}
|
|
|
| namespace policy {
|
|
|
| class CloudPolicyCacheBase;
|
| class CloudPolicyDataStore;
|
| class DelayedWorkScheduler;
|
| +class DeviceManagementRequestJob;
|
| class DeviceManagementService;
|
| class PolicyNotifier;
|
|
|
| @@ -23,8 +28,7 @@ class PolicyNotifier;
|
| // requested, otherwise from the device management server. An instance of the
|
| // fetcher is shared as a singleton by all users of the device management token
|
| // to ensure they all get the same token.
|
| -class DeviceTokenFetcher
|
| - : public DeviceManagementBackend::DeviceRegisterResponseDelegate {
|
| +class DeviceTokenFetcher {
|
| public:
|
| // |service| is used to talk to the device management service and |cache| is
|
| // used to persist whether the device is unmanaged.
|
| @@ -51,11 +55,6 @@ class DeviceTokenFetcher
|
| // Cancels any pending work on this fetcher and resets it to inactive state.
|
| void Reset();
|
|
|
| - // DeviceManagementBackend::DeviceRegisterResponseDelegate method overrides:
|
| - virtual void HandleRegisterResponse(
|
| - const enterprise_management::DeviceRegisterResponse& response) OVERRIDE;
|
| - virtual void OnError(DeviceManagementBackend::ErrorCode code) OVERRIDE;
|
| -
|
| private:
|
| friend class DeviceTokenFetcherTest;
|
|
|
| @@ -90,20 +89,25 @@ class DeviceTokenFetcher
|
| PolicyNotifier* notifier,
|
| DelayedWorkScheduler* scheduler);
|
|
|
| - // Moves the fetcher into a new state.
|
| - void SetState(FetcherState state);
|
| -
|
| // Resets |backend_|, then uses |auth_token_| and |device_id_| to perform
|
| // an actual token fetch.
|
| void FetchTokenInternal();
|
|
|
| + // Handles token fetch request completion.
|
| + void OnTokenFetchCompleted(
|
| + DeviceManagementStatus status,
|
| + const enterprise_management::DeviceManagementResponse& response);
|
| +
|
| + // Moves the fetcher into a new state.
|
| + void SetState(FetcherState state);
|
| +
|
| // DelayedWorkScheduler::Client:
|
| virtual void DoWork();
|
|
|
| // Service and backend. A new backend is created whenever the fetcher gets
|
| // reset.
|
| DeviceManagementService* service_; // weak
|
| - scoped_ptr<DeviceManagementBackend> backend_;
|
| + scoped_ptr<DeviceManagementRequestJob> request_job_;
|
|
|
| // Reference to the cache. Used to persist and read unmanaged state.
|
| CloudPolicyCacheBase* cache_;
|
|
|