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

Unified Diff: chrome/browser/managed_mode/managed_user_sync_service.h

Issue 23910002: Add synchronous and asynchronous methods to ManagedUserSyncService to get the list of managed users. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 months 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
« no previous file with comments | « no previous file | chrome/browser/managed_mode/managed_user_sync_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/managed_mode/managed_user_sync_service.h
diff --git a/chrome/browser/managed_mode/managed_user_sync_service.h b/chrome/browser/managed_mode/managed_user_sync_service.h
index b0aa4b8ae3d201bab7ee8de3b655ce87863a3f70..a624f414ea4c96702630f8f5be48eab49f739017 100644
--- a/chrome/browser/managed_mode/managed_user_sync_service.h
+++ b/chrome/browser/managed_mode/managed_user_sync_service.h
@@ -5,6 +5,9 @@
#ifndef CHROME_BROWSER_MANAGED_MODE_MANAGED_USER_SYNC_SERVICE_H_
#define CHROME_BROWSER_MANAGED_MODE_MANAGED_USER_SYNC_SERVICE_H_
+#include <vector>
+
+#include "base/callback_forward.h"
#include "base/memory/scoped_ptr.h"
#include "base/observer_list.h"
#include "base/prefs/pref_change_registrar.h"
@@ -13,15 +16,23 @@
#include "components/browser_context_keyed_service/browser_context_keyed_service.h"
#include "sync/api/syncable_service.h"
-class PrefService;
+namespace base {
+class DictionaryValue;
+}
namespace user_prefs {
class PrefRegistrySyncable;
}
+class PrefService;
+
class ManagedUserSyncService : public BrowserContextKeyedService,
public syncer::SyncableService {
public:
+ // For use with GetAllManagedUsers() below.
+ typedef base::Callback<void(const base::DictionaryValue*)>
+ ManagedUsersCallback;
+
virtual ~ManagedUserSyncService();
static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry);
@@ -34,6 +45,15 @@ class ManagedUserSyncService : public BrowserContextKeyedService,
const std::string& master_key);
void DeleteManagedUser(const std::string& id);
+ // Returns a dictionary containing all managed users managed by this
+ // custodian. This method should only be called if this service is syncing
+ // managed users (as the stored data might be outdated before that).
Pam (message me for reviews) 2013/09/05 11:11:56 I don't understand this comment. What does it mean
Bernhard Bauer 2013/09/05 12:15:41 A SyncableService needs to do an initial merge of
Pam (message me for reviews) 2013/09/05 12:29:30 OK -- could you add a brief comment explaining bot
Bernhard Bauer 2013/09/05 12:52:35 Done.
+ const base::DictionaryValue* GetManagedUsers();
+
+ // Calls the passed |callback| with a dictionary containing all managed users
+ // managed by this custodian.
+ void GetManagedUsersAsync(const ManagedUsersCallback& callback);
+
// BrowserContextKeyedService implementation:
virtual void Shutdown() OVERRIDE;
@@ -62,6 +82,8 @@ class ManagedUserSyncService : public BrowserContextKeyedService,
void NotifyManagedUserAcknowledged(const std::string& managed_user_id);
void NotifyManagedUsersSyncingStopped();
+ void DispatchCallbacks();
+
PrefService* prefs_;
PrefChangeRegistrar pref_change_registrar_;
@@ -70,6 +92,8 @@ class ManagedUserSyncService : public BrowserContextKeyedService,
ObserverList<ManagedUserSyncServiceObserver> observers_;
+ std::vector<ManagedUsersCallback> callbacks_;
+
DISALLOW_COPY_AND_ASSIGN(ManagedUserSyncService);
};
« no previous file with comments | « no previous file | chrome/browser/managed_mode/managed_user_sync_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698