| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_SUPERVISED_USER_LEGACY_SUPERVISED_USER_PREF_MAPPING_SERVI
CE_H_ | 5 #ifndef CHROME_BROWSER_SUPERVISED_USER_LEGACY_SUPERVISED_USER_PREF_MAPPING_SERVI
CE_H_ |
| 6 #define CHROME_BROWSER_SUPERVISED_USER_LEGACY_SUPERVISED_USER_PREF_MAPPING_SERVI
CE_H_ | 6 #define CHROME_BROWSER_SUPERVISED_USER_LEGACY_SUPERVISED_USER_PREF_MAPPING_SERVI
CE_H_ |
| 7 | 7 |
| 8 #include <memory> |
| 9 |
| 8 #include "base/callback.h" | 10 #include "base/callback.h" |
| 9 #include "base/callback_list.h" | 11 #include "base/callback_list.h" |
| 10 #include "base/macros.h" | 12 #include "base/macros.h" |
| 11 #include "base/memory/scoped_ptr.h" | |
| 12 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
| 13 #include "chrome/browser/supervised_user/supervised_users.h" | 14 #include "chrome/browser/supervised_user/supervised_users.h" |
| 14 #include "components/keyed_service/core/keyed_service.h" | 15 #include "components/keyed_service/core/keyed_service.h" |
| 15 #include "components/prefs/pref_change_registrar.h" | 16 #include "components/prefs/pref_change_registrar.h" |
| 16 | 17 |
| 17 class PrefService; | 18 class PrefService; |
| 18 class SupervisedUserSharedSettingsService; | 19 class SupervisedUserSharedSettingsService; |
| 19 | 20 |
| 20 // SupervisedUserPrefMappingService maps shared supervised user settings to user | 21 // SupervisedUserPrefMappingService maps shared supervised user settings to user |
| 21 // preferences. When a shared supervised user setting is updated via sync, the | 22 // preferences. When a shared supervised user setting is updated via sync, the |
| (...skipping 20 matching lines...) Expand all Loading... |
| 42 // sync data. Updates the corresponding user pref. | 43 // sync data. Updates the corresponding user pref. |
| 43 void OnSharedSettingChanged(const std::string& su_id, const std::string& key); | 44 void OnSharedSettingChanged(const std::string& su_id, const std::string& key); |
| 44 | 45 |
| 45 private: | 46 private: |
| 46 // Returns the current chrome avatar index that is stored as a supervised user | 47 // Returns the current chrome avatar index that is stored as a supervised user |
| 47 // shared setting, or -1 if no avatar index is stored. | 48 // shared setting, or -1 if no avatar index is stored. |
| 48 int GetChromeAvatarIndex(); | 49 int GetChromeAvatarIndex(); |
| 49 | 50 |
| 50 PrefService* prefs_; | 51 PrefService* prefs_; |
| 51 SupervisedUserSharedSettingsService* shared_settings_; | 52 SupervisedUserSharedSettingsService* shared_settings_; |
| 52 scoped_ptr<CallbackList::Subscription> subscription_; | 53 std::unique_ptr<CallbackList::Subscription> subscription_; |
| 53 std::string supervised_user_id_; | 54 std::string supervised_user_id_; |
| 54 PrefChangeRegistrar pref_change_registrar_; | 55 PrefChangeRegistrar pref_change_registrar_; |
| 55 base::WeakPtrFactory<SupervisedUserPrefMappingService> weak_ptr_factory_; | 56 base::WeakPtrFactory<SupervisedUserPrefMappingService> weak_ptr_factory_; |
| 56 | 57 |
| 57 DISALLOW_COPY_AND_ASSIGN(SupervisedUserPrefMappingService); | 58 DISALLOW_COPY_AND_ASSIGN(SupervisedUserPrefMappingService); |
| 58 }; | 59 }; |
| 59 | 60 |
| 60 #endif // CHROME_BROWSER_SUPERVISED_USER_LEGACY_SUPERVISED_USER_PREF_MAPPING_SE
RVICE_H_ | 61 #endif // CHROME_BROWSER_SUPERVISED_USER_LEGACY_SUPERVISED_USER_PREF_MAPPING_SE
RVICE_H_ |
| OLD | NEW |