Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_MANAGED_MODE_MANAGED_USER_SETTINGS_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_MANAGED_MODE_MANAGED_USER_SETTINGS_SERVICE_H_ |
| 6 #define CHROME_BROWSER_MANAGED_MODE_MANAGED_USER_SETTINGS_SERVICE_H_ | 6 #define CHROME_BROWSER_MANAGED_MODE_MANAGED_USER_SETTINGS_SERVICE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 71 | 71 |
| 72 // Initializes the service by loading its settings from the |pref_store|. | 72 // Initializes the service by loading its settings from the |pref_store|. |
| 73 // Use this method in tests to inject a different PrefStore than the | 73 // Use this method in tests to inject a different PrefStore than the |
| 74 // default one. | 74 // default one. |
| 75 void Init(scoped_refptr<PersistentPrefStore> pref_store); | 75 void Init(scoped_refptr<PersistentPrefStore> pref_store); |
| 76 | 76 |
| 77 // Adds a callback to be called when managed user settings are initially | 77 // Adds a callback to be called when managed user settings are initially |
| 78 // available, or when they change. | 78 // available, or when they change. |
| 79 void Subscribe(const SettingsCallback& callback); | 79 void Subscribe(const SettingsCallback& callback); |
| 80 | 80 |
| 81 // Activates the service. This happens when the user is managed. | 81 // Activates/deactivates the service. This is called by the ManagedUserService |
| 82 void Activate(); | 82 // when itself is (de)activated. |
|
Bernhard Bauer
2014/06/04 08:57:42
Language nit: you only need the "self" part if you
Marc Treib
2014/06/04 09:23:25
Done.
| |
| 83 void SetActive(bool active); | |
| 83 | 84 |
| 84 // Whether managed user settings are available. | 85 // Whether managed user settings are available. |
| 85 bool IsReady(); | 86 bool IsReady(); |
| 86 | 87 |
| 87 // Clears all managed user settings and items. | 88 // Clears all managed user settings and items. |
| 88 void Clear(); | 89 void Clear(); |
| 89 | 90 |
| 90 // Constructs a key for a split managed user setting from a prefix and a | 91 // Constructs a key for a split managed user setting from a prefix and a |
| 91 // variable key. | 92 // variable key. |
| 92 static std::string MakeSplitSettingKey(const std::string& prefix, | 93 static std::string MakeSplitSettingKey(const std::string& prefix, |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 158 | 159 |
| 159 std::vector<SettingsCallback> subscribers_; | 160 std::vector<SettingsCallback> subscribers_; |
| 160 | 161 |
| 161 scoped_ptr<syncer::SyncChangeProcessor> sync_processor_; | 162 scoped_ptr<syncer::SyncChangeProcessor> sync_processor_; |
| 162 scoped_ptr<syncer::SyncErrorFactory> error_handler_; | 163 scoped_ptr<syncer::SyncErrorFactory> error_handler_; |
| 163 | 164 |
| 164 DISALLOW_COPY_AND_ASSIGN(ManagedUserSettingsService); | 165 DISALLOW_COPY_AND_ASSIGN(ManagedUserSettingsService); |
| 165 }; | 166 }; |
| 166 | 167 |
| 167 #endif // CHROME_BROWSER_MANAGED_MODE_MANAGED_USER_SETTINGS_SERVICE_H_ | 168 #endif // CHROME_BROWSER_MANAGED_MODE_MANAGED_USER_SETTINGS_SERVICE_H_ |
| OLD | NEW |