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

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

Issue 11444029: Added UserPolicySigninService::FetchPolicyForSignedInUser(). (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_service.h
diff --git a/chrome/browser/policy/cloud_policy_service.h b/chrome/browser/policy/cloud_policy_service.h
index 52ebe00be11dc9fdaaf0385ae7b57b7cb15af20a..85258f2a8874b73f5e43a28d34be8103b2ce1f9a 100644
--- a/chrome/browser/policy/cloud_policy_service.h
+++ b/chrome/browser/policy/cloud_policy_service.h
@@ -41,9 +41,13 @@ class CloudPolicyService : public CloudPolicyClient::Observer,
// policy blob. Empty if not managed/not available.
std::string ManagedBy() const;
+ // Callback invoked once the policy refresh attempt has completed. Passed
+ // bool parameter is true if the refresh was successful (no error).
+ typedef base::Callback<void(bool)> RefreshPolicyCallback;
Mattias Nissler (ping if slow) 2012/12/07 15:20:45 typedefs should go right after public: per the sty
Andrew T Wilson (Slow) 2012/12/07 17:34:29 Done.
+
// Refreshes policy. |callback| will be invoked after the operation completes
// or aborts because of errors.
- void RefreshPolicy(const base::Closure& callback);
+ void RefreshPolicy(const RefreshPolicyCallback& callback);
// Adds/Removes an Observer for this object.
void AddObserver(Observer* observer);
@@ -65,8 +69,9 @@ class CloudPolicyService : public CloudPolicyClient::Observer,
// which is responsible for notifying observers.
void CheckInitializationCompleted();
- // Invokes the refresh callbacks and clears refresh state.
- void RefreshCompleted();
+ // Invokes the refresh callbacks and clears refresh state. The |success| flag
+ // is passed through to the refresh callbacks.
+ void RefreshCompleted(bool success);
// The client used to talk to the cloud.
CloudPolicyClient* client_;
@@ -85,7 +90,7 @@ class CloudPolicyService : public CloudPolicyClient::Observer,
} refresh_state_;
// Callbacks to invoke upon policy refresh.
- std::vector<base::Closure> refresh_callbacks_;
+ std::vector<RefreshPolicyCallback> refresh_callbacks_;
// Set to true once the service is initialized (initial policy load/refresh
// is complete).

Powered by Google App Engine
This is Rietveld 408576698