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

Unified Diff: chrome/browser/supervised_user/supervised_user_settings_service.h

Issue 1300643002: Added user settings to chrome://supervised-user-internals. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: SupervisedUserSettingsService supports unsubscription Created 5 years, 4 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
Index: chrome/browser/supervised_user/supervised_user_settings_service.h
diff --git a/chrome/browser/supervised_user/supervised_user_settings_service.h b/chrome/browser/supervised_user/supervised_user_settings_service.h
index 7a7041ef3953693e44dc2b8aaccb5530ab2a3e57..071da47621b8130b273863cf4185efb5988a982c 100644
--- a/chrome/browser/supervised_user/supervised_user_settings_service.h
+++ b/chrome/browser/supervised_user/supervised_user_settings_service.h
@@ -9,6 +9,7 @@
#include <vector>
#include "base/callback.h"
+#include "base/callback_list.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/prefs/pref_store.h"
@@ -56,7 +57,9 @@ class SupervisedUserSettingsService : public KeyedService,
// A callback whose first parameter is a dictionary containing all supervised
// user settings. If the dictionary is NULL, it means that the service is
// inactive, i.e. the user is not supervised.
- typedef base::Callback<void(const base::DictionaryValue*)> SettingsCallback;
+ using SettingsCallbackType = void(const base::DictionaryValue*);
+ using SettingsCallback = base::Callback<SettingsCallbackType>;
+ using SettingsCallbackList = base::CallbackList<SettingsCallbackType>;
SupervisedUserSettingsService();
~SupervisedUserSettingsService() override;
@@ -76,7 +79,8 @@ class SupervisedUserSettingsService : public KeyedService,
// Adds a callback to be called when supervised user settings are initially
// available, or when they change.
- void Subscribe(const SettingsCallback& callback);
+ scoped_ptr<base::CallbackList<SettingsCallbackType>::Subscription>
+ Subscribe(const SettingsCallback& callback);
// Activates/deactivates the service. This is called by the
// SupervisedUserService when it is (de)activated.
@@ -157,7 +161,7 @@ class SupervisedUserSettingsService : public KeyedService,
// A set of local settings that are fixed and not configured remotely.
scoped_ptr<base::DictionaryValue> local_settings_;
- std::vector<SettingsCallback> subscribers_;
+ SettingsCallbackList callback_list_;
scoped_ptr<syncer::SyncChangeProcessor> sync_processor_;
scoped_ptr<syncer::SyncErrorFactory> error_handler_;

Powered by Google App Engine
This is Rietveld 408576698