| 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 |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 const std::string& key); | 94 const std::string& key); |
| 95 | 95 |
| 96 // Uploads an item to the Sync server. Items are the same data structure as | 96 // Uploads an item to the Sync server. Items are the same data structure as |
| 97 // supervised user settings (i.e. key-value pairs, as described at the top of | 97 // supervised user settings (i.e. key-value pairs, as described at the top of |
| 98 // the file), but they are only uploaded (whereas supervised user settings are | 98 // the file), but they are only uploaded (whereas supervised user settings are |
| 99 // only downloaded), and never passed to the preference system. | 99 // only downloaded), and never passed to the preference system. |
| 100 // An example of an uploaded item is an access request to a blocked URL. | 100 // An example of an uploaded item is an access request to a blocked URL. |
| 101 void UploadItem(const std::string& key, scoped_ptr<base::Value> value); | 101 void UploadItem(const std::string& key, scoped_ptr<base::Value> value); |
| 102 | 102 |
| 103 // Sets the setting with the given |key| to a copy of the given |value|. | 103 // Sets the setting with the given |key| to a copy of the given |value|. |
| 104 void SetLocalSetting(const std::string& key, | 104 void SetLocalSetting(const std::string& key, scoped_ptr<base::Value> value); |
| 105 scoped_ptr<base::Value> value); | |
| 106 | 105 |
| 107 // Public for testing. | 106 // Public for testing. |
| 108 static syncer::SyncData CreateSyncDataForSetting(const std::string& name, | 107 static syncer::SyncData CreateSyncDataForSetting(const std::string& name, |
| 109 const base::Value& value); | 108 const base::Value& value); |
| 110 | 109 |
| 111 // KeyedService implementation: | 110 // KeyedService implementation: |
| 112 void Shutdown() override; | 111 void Shutdown() override; |
| 113 | 112 |
| 114 // SyncableService implementation: | 113 // SyncableService implementation: |
| 115 syncer::SyncMergeResult MergeDataAndStartSyncing( | 114 syncer::SyncMergeResult MergeDataAndStartSyncing( |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 | 157 |
| 159 std::vector<SettingsCallback> subscribers_; | 158 std::vector<SettingsCallback> subscribers_; |
| 160 | 159 |
| 161 scoped_ptr<syncer::SyncChangeProcessor> sync_processor_; | 160 scoped_ptr<syncer::SyncChangeProcessor> sync_processor_; |
| 162 scoped_ptr<syncer::SyncErrorFactory> error_handler_; | 161 scoped_ptr<syncer::SyncErrorFactory> error_handler_; |
| 163 | 162 |
| 164 DISALLOW_COPY_AND_ASSIGN(SupervisedUserSettingsService); | 163 DISALLOW_COPY_AND_ASSIGN(SupervisedUserSettingsService); |
| 165 }; | 164 }; |
| 166 | 165 |
| 167 #endif // CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_SETTINGS_SERVICE_H_ | 166 #endif // CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_SETTINGS_SERVICE_H_ |
| OLD | NEW |