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 SetLocalSettingForTesting(const std::string& key, | 104 void SetLocalSetting(const std::string& key, |
105 scoped_ptr<base::Value> value); | 105 scoped_ptr<base::Value> value); |
106 | 106 |
107 // Public for testing. | 107 // Public for testing. |
108 static syncer::SyncData CreateSyncDataForSetting(const std::string& name, | 108 static syncer::SyncData CreateSyncDataForSetting(const std::string& name, |
109 const base::Value& value); | 109 const base::Value& value); |
110 | 110 |
111 // KeyedService implementation: | 111 // KeyedService implementation: |
112 void Shutdown() override; | 112 void Shutdown() override; |
113 | 113 |
114 // SyncableService implementation: | 114 // SyncableService implementation: |
115 syncer::SyncMergeResult MergeDataAndStartSyncing( | 115 syncer::SyncMergeResult MergeDataAndStartSyncing( |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 | 158 |
159 std::vector<SettingsCallback> subscribers_; | 159 std::vector<SettingsCallback> subscribers_; |
160 | 160 |
161 scoped_ptr<syncer::SyncChangeProcessor> sync_processor_; | 161 scoped_ptr<syncer::SyncChangeProcessor> sync_processor_; |
162 scoped_ptr<syncer::SyncErrorFactory> error_handler_; | 162 scoped_ptr<syncer::SyncErrorFactory> error_handler_; |
163 | 163 |
164 DISALLOW_COPY_AND_ASSIGN(SupervisedUserSettingsService); | 164 DISALLOW_COPY_AND_ASSIGN(SupervisedUserSettingsService); |
165 }; | 165 }; |
166 | 166 |
167 #endif // CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_SETTINGS_SERVICE_H_ | 167 #endif // CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_SETTINGS_SERVICE_H_ |
OLD | NEW |