| 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_WHITELIST_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_WHITELIST_SERVICE_H_ |
| 6 #define CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_WHITELIST_SERVICE_H_ | 6 #define CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_WHITELIST_SERVICE_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <memory> |
| 9 #include <set> | 10 #include <set> |
| 10 #include <string> | 11 #include <string> |
| 11 | 12 |
| 12 #include "base/macros.h" | 13 #include "base/macros.h" |
| 13 #include "base/memory/scoped_ptr.h" | |
| 14 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
| 15 #include "base/strings/string16.h" | 15 #include "base/strings/string16.h" |
| 16 #include "base/time/time.h" | 16 #include "base/time/time.h" |
| 17 #include "chrome/browser/supervised_user/supervised_users.h" | 17 #include "chrome/browser/supervised_user/supervised_users.h" |
| 18 #include "sync/api/syncable_service.h" | 18 #include "sync/api/syncable_service.h" |
| 19 | 19 |
| 20 class PrefService; | 20 class PrefService; |
| 21 class SupervisedUserSiteList; | 21 class SupervisedUserSiteList; |
| 22 | 22 |
| 23 namespace base { | 23 namespace base { |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 | 73 |
| 74 // Creates Sync data for a whitelist with the given |id| and |name|. | 74 // Creates Sync data for a whitelist with the given |id| and |name|. |
| 75 // Public for testing. | 75 // Public for testing. |
| 76 static syncer::SyncData CreateWhitelistSyncData(const std::string& id, | 76 static syncer::SyncData CreateWhitelistSyncData(const std::string& id, |
| 77 const std::string& name); | 77 const std::string& name); |
| 78 | 78 |
| 79 // SyncableService implementation: | 79 // SyncableService implementation: |
| 80 syncer::SyncMergeResult MergeDataAndStartSyncing( | 80 syncer::SyncMergeResult MergeDataAndStartSyncing( |
| 81 syncer::ModelType type, | 81 syncer::ModelType type, |
| 82 const syncer::SyncDataList& initial_sync_data, | 82 const syncer::SyncDataList& initial_sync_data, |
| 83 scoped_ptr<syncer::SyncChangeProcessor> sync_processor, | 83 std::unique_ptr<syncer::SyncChangeProcessor> sync_processor, |
| 84 scoped_ptr<syncer::SyncErrorFactory> error_handler) override; | 84 std::unique_ptr<syncer::SyncErrorFactory> error_handler) override; |
| 85 void StopSyncing(syncer::ModelType type) override; | 85 void StopSyncing(syncer::ModelType type) override; |
| 86 syncer::SyncDataList GetAllSyncData(syncer::ModelType type) const override; | 86 syncer::SyncDataList GetAllSyncData(syncer::ModelType type) const override; |
| 87 syncer::SyncError ProcessSyncChanges( | 87 syncer::SyncError ProcessSyncChanges( |
| 88 const tracked_objects::Location& from_here, | 88 const tracked_objects::Location& from_here, |
| 89 const syncer::SyncChangeList& change_list) override; | 89 const syncer::SyncChangeList& change_list) override; |
| 90 | 90 |
| 91 private: | 91 private: |
| 92 // The following methods handle whitelist additions, updates and removals, | 92 // The following methods handle whitelist additions, updates and removals, |
| 93 // usually coming from Sync. | 93 // usually coming from Sync. |
| 94 void AddNewWhitelist(base::DictionaryValue* pref_dict, | 94 void AddNewWhitelist(base::DictionaryValue* pref_dict, |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 std::set<std::string> registered_whitelists_; | 134 std::set<std::string> registered_whitelists_; |
| 135 std::map<std::string, scoped_refptr<SupervisedUserSiteList> > | 135 std::map<std::string, scoped_refptr<SupervisedUserSiteList> > |
| 136 loaded_whitelists_; | 136 loaded_whitelists_; |
| 137 | 137 |
| 138 base::WeakPtrFactory<SupervisedUserWhitelistService> weak_ptr_factory_; | 138 base::WeakPtrFactory<SupervisedUserWhitelistService> weak_ptr_factory_; |
| 139 | 139 |
| 140 DISALLOW_COPY_AND_ASSIGN(SupervisedUserWhitelistService); | 140 DISALLOW_COPY_AND_ASSIGN(SupervisedUserWhitelistService); |
| 141 }; | 141 }; |
| 142 | 142 |
| 143 #endif // CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_WHITELIST_SERVICE_H_ | 143 #endif // CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_WHITELIST_SERVICE_H_ |
| OLD | NEW |