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 <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 private: | 85 private: |
86 // The following methods handle whitelist additions, updates and removals, | 86 // The following methods handle whitelist additions, updates and removals, |
87 // usually coming from Sync. | 87 // usually coming from Sync. |
88 void AddNewWhitelist(base::DictionaryValue* pref_dict, | 88 void AddNewWhitelist(base::DictionaryValue* pref_dict, |
89 const sync_pb::ManagedUserWhitelistSpecifics& whitelist); | 89 const sync_pb::ManagedUserWhitelistSpecifics& whitelist); |
90 void SetWhitelistProperties( | 90 void SetWhitelistProperties( |
91 base::DictionaryValue* pref_dict, | 91 base::DictionaryValue* pref_dict, |
92 const sync_pb::ManagedUserWhitelistSpecifics& whitelist); | 92 const sync_pb::ManagedUserWhitelistSpecifics& whitelist); |
93 void RemoveWhitelist(base::DictionaryValue* pref_dict, const std::string& id); | 93 void RemoveWhitelist(base::DictionaryValue* pref_dict, const std::string& id); |
94 | 94 |
| 95 enum WhitelistSource { |
| 96 FROM_SYNC, |
| 97 FROM_COMMAND_LINE, |
| 98 }; |
| 99 |
95 // Registers a new or existing whitelist. | 100 // Registers a new or existing whitelist. |
96 void RegisterWhitelist(const std::string& id, | 101 void RegisterWhitelist(const std::string& id, |
97 const std::string& name, | 102 const std::string& name, |
98 bool new_installation); | 103 WhitelistSource source); |
99 | 104 |
100 void GetLoadedWhitelists( | 105 void GetLoadedWhitelists( |
101 std::vector<scoped_refptr<SupervisedUserSiteList>>* whitelists); | 106 std::vector<scoped_refptr<SupervisedUserSiteList>>* whitelists); |
102 | 107 |
103 void NotifyWhitelistsChanged(); | 108 void NotifyWhitelistsChanged(); |
104 | 109 |
105 void OnWhitelistReady(const std::string& id, | 110 void OnWhitelistReady(const std::string& id, |
106 const base::FilePath& whitelist_path); | 111 const base::FilePath& whitelist_path); |
107 void OnWhitelistLoaded( | 112 void OnWhitelistLoaded( |
108 const std::string& id, | 113 const std::string& id, |
(...skipping 12 matching lines...) Expand all Loading... |
121 std::set<std::string> registered_whitelists_; | 126 std::set<std::string> registered_whitelists_; |
122 std::map<std::string, scoped_refptr<SupervisedUserSiteList> > | 127 std::map<std::string, scoped_refptr<SupervisedUserSiteList> > |
123 loaded_whitelists_; | 128 loaded_whitelists_; |
124 | 129 |
125 base::WeakPtrFactory<SupervisedUserWhitelistService> weak_ptr_factory_; | 130 base::WeakPtrFactory<SupervisedUserWhitelistService> weak_ptr_factory_; |
126 | 131 |
127 DISALLOW_COPY_AND_ASSIGN(SupervisedUserWhitelistService); | 132 DISALLOW_COPY_AND_ASSIGN(SupervisedUserWhitelistService); |
128 }; | 133 }; |
129 | 134 |
130 #endif // CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_WHITELIST_SERVICE_H_ | 135 #endif // CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_WHITELIST_SERVICE_H_ |
OLD | NEW |