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

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

Issue 11299305: Break CloudPolicyRefreshScheduler's dependency on PrefService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Created 8 years 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_policy_refresh_scheduler.h
diff --git a/chrome/browser/policy/cloud_policy_refresh_scheduler.h b/chrome/browser/policy/cloud_policy_refresh_scheduler.h
index e2ecb6edc9659fc37eea582e93fa5976c16a104c..f47d3722cc0675440ef51334db548eba2679a517 100644
--- a/chrome/browser/policy/cloud_policy_refresh_scheduler.h
+++ b/chrome/browser/policy/cloud_policy_refresh_scheduler.h
@@ -11,7 +11,6 @@
#include "base/cancelable_callback.h"
#include "base/memory/ref_counted.h"
#include "base/time.h"
-#include "chrome/browser/api/prefs/pref_member.h"
#include "chrome/browser/policy/cloud_policy_client.h"
#include "chrome/browser/policy/cloud_policy_store.h"
#include "net/base/network_change_notifier.h"
@@ -32,6 +31,7 @@ class CloudPolicyRefreshScheduler
public net::NetworkChangeNotifier::IPAddressObserver {
public:
// Refresh constants.
+ static const int64 kDefaultRefreshDelayMs;
static const int64 kUnmanagedRefreshDelayMs;
static const int64 kInitialErrorRetryDelayMs;
@@ -44,11 +44,12 @@ class CloudPolicyRefreshScheduler
CloudPolicyRefreshScheduler(
CloudPolicyClient* client,
CloudPolicyStore* store,
- PrefService* prefs,
- const std::string& refresh_pref,
const scoped_refptr<base::TaskRunner>& task_runner);
virtual ~CloudPolicyRefreshScheduler();
+ // Sets the refresh delay to |refresh_delay| (subject to min/max clamping).
+ void SetRefreshDelay(int64 refresh_delay);
+
// CloudPolicyClient::Observer:
virtual void OnPolicyFetched(CloudPolicyClient* client) OVERRIDE;
virtual void OnRegistrationStateChanged(CloudPolicyClient* client) OVERRIDE;
@@ -98,7 +99,8 @@ class CloudPolicyRefreshScheduler
// Error retry delay in milliseconds.
int64 error_retry_delay_ms_;
- IntegerPrefMember refresh_delay_;
+ // The refresh delay.
+ int64 refresh_delay_ms_;
DISALLOW_COPY_AND_ASSIGN(CloudPolicyRefreshScheduler);
};

Powered by Google App Engine
This is Rietveld 408576698