#ifndef CHROME_BROWSER_MANAGED_MODE_SUPERVISED_USER_PREF_MAPPING_SERVICE_H_
#define CHROME_BROWSER_MANAGED_MODE_SUPERVISED_USER_PREF_MAPPING_SERVICE_H_
#include "base/callback.h"
#include "base/callback_list.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/prefs/pref_change_registrar.h"
#include "chrome/browser/managed_mode/managed_users.h"
#include "components/keyed_service/core/keyed_service.h"
class ManagedUserSharedSettingsService;
class PrefService;
class SupervisedUserPrefMappingService : public KeyedService {
public:
typedef base::CallbackList<void(const std::string&, const std::string&)>
CallbackList;
SupervisedUserPrefMappingService(
PrefService* prefs,
ManagedUserSharedSettingsService* shared_settings);
virtual ~SupervisedUserPrefMappingService();
virtual void Shutdown() OVERRIDE;
void Init();
void OnAvatarChanged();
void OnSharedSettingChanged(const std::string& mu_id, const std::string& key);
private:
int GetChromeAvatarIndex();
PrefService* prefs_;
ManagedUserSharedSettingsService* shared_settings_;
scoped_ptr<CallbackList::Subscription> subscription_;
std::string managed_user_id_;
PrefChangeRegistrar pref_change_registrar_;
base::WeakPtrFactory<SupervisedUserPrefMappingService> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(SupervisedUserPrefMappingService);
};
#endif