| 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 1d57571b4aba61d0da045b0a09dbeef445206c07..430517ea71a122f7d9cd9a45cc87775429d8405d 100644
|
| --- a/chrome/browser/policy/device_management_policy_provider.h
|
| +++ b/chrome/browser/policy/device_management_policy_provider.h
|
| @@ -56,10 +56,8 @@ class DeviceManagementPolicyProvider
|
| // server and no response or error has yet been received.
|
| bool IsPolicyRequestPending() const { return policy_request_pending_; }
|
|
|
| - // Returns true if the device management policy provider has an empty policy
|
| - // cache and is waiting for a pending policy request to retrive the inital
|
| - // set of policies. If cached policies are available false is returned even in
|
| - // the case of a pending policy request.
|
| + // Returns true if the device management policy provider is currently waiting
|
| + // for the first attempt to fetch policies to complete.
|
| bool WaitingForInitialPolicies() const;
|
|
|
| // Tells the provider that the passed in token service reference is about to
|
| @@ -72,11 +70,27 @@ class DeviceManagementPolicyProvider
|
|
|
| friend class DeviceManagementPolicyProviderTest;
|
|
|
| + // More configurable constructor for use by test cases.
|
| + DeviceManagementPolicyProvider(const PolicyDefinitionList* policy_list,
|
| + DeviceManagementBackend* backend,
|
| + Profile* profile,
|
| + int64 policy_refresh_rate_ms,
|
| + int64 policy_refresh_max_earlier_ms,
|
| + int64 policy_refresh_error_delay_ms,
|
| + int64 token_fetch_error_delay_ms,
|
| + int64 unmanaged_device_refresh_rate_ms);
|
| +
|
| // 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
|
| // the case in InitializeAfterIOThreadExists.
|
| - void Initialize();
|
| + void Initialize(DeviceManagementBackend* backend,
|
| + Profile* profile,
|
| + int64 policy_refresh_rate_ms,
|
| + int64 policy_refresh_max_earlier_ms,
|
| + int64 policy_refresh_error_delay_ms,
|
| + int64 token_fetch_error_delay_ms,
|
| + int64 unmanaged_device_refresh_rate_ms);
|
|
|
| // Called by a deferred task posted to the UI thread to complete the portion
|
| // of initialization that requires the IOThread.
|
| @@ -96,9 +110,7 @@ class DeviceManagementPolicyProvider
|
| // Calculates when the next RefreshTask shall be executed.
|
| int64 GetRefreshTaskDelay();
|
|
|
| - // Returns true if the policy cache is empty and hence no policies are
|
| - // available.
|
| - bool IsPolicyCacheEmpty() const;
|
| + void StopWaitingForInitialPolicies();
|
|
|
| #if defined(OS_CHROMEOS)
|
| // Send a CLOUD_POLICY_UPDATE notification.
|
| @@ -120,20 +132,6 @@ class DeviceManagementPolicyProvider
|
| static FilePath GetOrCreateDeviceManagementDir(
|
| const FilePath& user_data_dir);
|
|
|
| - // Give unit tests the ability to override timeout settings.
|
| - void set_policy_refresh_rate_ms(int64 policy_refresh_rate_ms) {
|
| - policy_refresh_rate_ms_ = policy_refresh_rate_ms;
|
| - }
|
| - void set_policy_refresh_max_earlier_ms(int64 policy_refresh_max_earlier_ms) {
|
| - policy_refresh_max_earlier_ms_ = policy_refresh_max_earlier_ms;
|
| - }
|
| - void set_policy_refresh_error_delay_ms(int64 policy_refresh_error_delay_ms) {
|
| - policy_refresh_error_delay_ms_ = policy_refresh_error_delay_ms;
|
| - }
|
| - void set_token_fetch_error_delay_ms(int64 token_fetch_error_delay_ms) {
|
| - token_fetch_error_delay_ms_ = token_fetch_error_delay_ms;
|
| - }
|
| -
|
| scoped_ptr<DeviceManagementBackend> backend_;
|
| Profile* profile_; // weak
|
| scoped_ptr<DeviceManagementPolicyCache> cache_;
|
| @@ -142,10 +140,12 @@ class DeviceManagementPolicyProvider
|
| FilePath storage_dir_;
|
| bool policy_request_pending_;
|
| bool refresh_task_pending_;
|
| + bool waiting_for_initial_policies_;
|
| int64 policy_refresh_rate_ms_;
|
| int64 policy_refresh_max_earlier_ms_;
|
| int64 policy_refresh_error_delay_ms_;
|
| int64 token_fetch_error_delay_ms_;
|
| + int64 unmanaged_device_refresh_rate_ms_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(DeviceManagementPolicyProvider);
|
| };
|
|
|