Chromium Code Reviews| 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_SUPERVISED_USER_SETTINGS_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_SETTINGS_SERVICE_H_ |
| 6 #define CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_SETTINGS_SERVICE_H_ | 6 #define CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_SETTINGS_SERVICE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/callback.h" | 11 #include "base/callback.h" |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "base/prefs/pref_store.h" | 14 #include "base/prefs/pref_store.h" |
| 15 #include "base/values.h" | 15 #include "base/values.h" |
| 16 #include "chrome/browser/supervised_user/supervised_users.h" | 16 #include "chrome/browser/supervised_user/supervised_users.h" |
| 17 #include "components/keyed_service/core/keyed_service.h" | 17 #include "components/keyed_service/core/keyed_service.h" |
| 18 #include "sync/api/syncable_service.h" | 18 #include "sync/api/syncable_service.h" |
| 19 | 19 |
| 20 class HostContentSettingsMap; | |
| 20 class PersistentPrefStore; | 21 class PersistentPrefStore; |
| 21 class Profile; | 22 class Profile; |
| 22 | 23 |
| 23 namespace base { | 24 namespace base { |
| 24 class FilePath; | 25 class FilePath; |
| 25 class SequencedTaskRunner; | 26 class SequencedTaskRunner; |
| 26 } | 27 } |
| 27 | 28 |
| 28 // This class syncs supervised user settings from a server, which are mapped to | 29 // This class syncs supervised user settings from a server, which are mapped to |
| 29 // preferences. The downloaded settings are persisted in a PrefStore (which is | 30 // preferences. The downloaded settings are persisted in a PrefStore (which is |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 71 | 72 |
| 72 // Initializes the service by loading its settings from the |pref_store|. | 73 // Initializes the service by loading its settings from the |pref_store|. |
| 73 // Use this method in tests to inject a different PrefStore than the | 74 // Use this method in tests to inject a different PrefStore than the |
| 74 // default one. | 75 // default one. |
| 75 void Init(scoped_refptr<PersistentPrefStore> pref_store); | 76 void Init(scoped_refptr<PersistentPrefStore> pref_store); |
| 76 | 77 |
| 77 // Adds a callback to be called when supervised user settings are initially | 78 // Adds a callback to be called when supervised user settings are initially |
| 78 // available, or when they change. | 79 // available, or when they change. |
| 79 void Subscribe(const SettingsCallback& callback); | 80 void Subscribe(const SettingsCallback& callback); |
| 80 | 81 |
| 82 // Register own content settings provider with the specified map. | |
| 83 void RegisterContentSettings( | |
|
Bernhard Bauer
2015/02/26 12:44:58
Why does the SupervisedUserSettingsService now hav
knn
2015/02/26 16:18:56
HostContentSettingsMap is a component so it cannot
Bernhard Bauer
2015/02/26 18:03:54
Hm, I'm wondering whether we could have an embedde
| |
| 84 HostContentSettingsMap* host_content_settings_map); | |
| 85 | |
| 81 // Activates/deactivates the service. This is called by the | 86 // Activates/deactivates the service. This is called by the |
| 82 // SupervisedUserService when it is (de)activated. | 87 // SupervisedUserService when it is (de)activated. |
| 83 void SetActive(bool active); | 88 void SetActive(bool active); |
| 84 | 89 |
| 85 // Whether supervised user settings are available. | 90 // Whether supervised user settings are available. |
| 86 bool IsReady(); | 91 bool IsReady(); |
| 87 | 92 |
| 88 // Clears all supervised user settings and items. | 93 // Clears all supervised user settings and items. |
| 89 void Clear(); | 94 void Clear(); |
| 90 | 95 |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 157 | 162 |
| 158 std::vector<SettingsCallback> subscribers_; | 163 std::vector<SettingsCallback> subscribers_; |
| 159 | 164 |
| 160 scoped_ptr<syncer::SyncChangeProcessor> sync_processor_; | 165 scoped_ptr<syncer::SyncChangeProcessor> sync_processor_; |
| 161 scoped_ptr<syncer::SyncErrorFactory> error_handler_; | 166 scoped_ptr<syncer::SyncErrorFactory> error_handler_; |
| 162 | 167 |
| 163 DISALLOW_COPY_AND_ASSIGN(SupervisedUserSettingsService); | 168 DISALLOW_COPY_AND_ASSIGN(SupervisedUserSettingsService); |
| 164 }; | 169 }; |
| 165 | 170 |
| 166 #endif // CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_SETTINGS_SERVICE_H_ | 171 #endif // CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_SETTINGS_SERVICE_H_ |
| OLD | NEW |