| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // Utilities for the SafeBrowsing code. | 5 // Utilities for the SafeBrowsing code. |
| 6 | 6 |
| 7 #ifndef CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_UTIL_H_ | 7 #ifndef CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_UTIL_H_ |
| 8 #define CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_UTIL_H_ | 8 #define CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_UTIL_H_ |
| 9 | 9 |
| 10 #include <cstring> | 10 #include <cstring> |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 // SafeBrowsing download whitelist list name. | 165 // SafeBrowsing download whitelist list name. |
| 166 extern const char kDownloadWhiteList[]; | 166 extern const char kDownloadWhiteList[]; |
| 167 // SafeBrowsing extension list name. | 167 // SafeBrowsing extension list name. |
| 168 extern const char kExtensionBlacklist[]; | 168 extern const char kExtensionBlacklist[]; |
| 169 // SafeBrowsing side-effect free whitelist name. | 169 // SafeBrowsing side-effect free whitelist name. |
| 170 extern const char kSideEffectFreeWhitelist[]; | 170 extern const char kSideEffectFreeWhitelist[]; |
| 171 // SafeBrowsing csd malware IP blacklist name. | 171 // SafeBrowsing csd malware IP blacklist name. |
| 172 extern const char kIPBlacklist[]; | 172 extern const char kIPBlacklist[]; |
| 173 // SafeBrowsing unwanted URL list. | 173 // SafeBrowsing unwanted URL list. |
| 174 extern const char kUnwantedUrlList[]; | 174 extern const char kUnwantedUrlList[]; |
| 175 // SafeBrowsing off-domain inclusion whitelist list name. |
| 176 extern const char kInclusionWhitelist[]; |
| 175 | 177 |
| 176 // This array must contain all Safe Browsing lists. | 178 // This array must contain all Safe Browsing lists. |
| 177 extern const char* kAllLists[9]; | 179 extern const char* kAllLists[10]; |
| 178 | 180 |
| 179 enum ListType { | 181 enum ListType { |
| 180 INVALID = -1, | 182 INVALID = -1, |
| 181 MALWARE = 0, | 183 MALWARE = 0, |
| 182 PHISH = 1, | 184 PHISH = 1, |
| 183 BINURL = 2, | 185 BINURL = 2, |
| 184 // Obsolete BINHASH = 3, | 186 // Obsolete BINHASH = 3, |
| 185 CSDWHITELIST = 4, | 187 CSDWHITELIST = 4, |
| 186 // SafeBrowsing lists are stored in pairs. Keep ListType 5 | 188 // SafeBrowsing lists are stored in pairs. Keep ListType 5 |
| 187 // available for a potential second list that we would store in the | 189 // available for a potential second list that we would store in the |
| 188 // csd-whitelist store file. | 190 // csd-whitelist store file. |
| 189 DOWNLOADWHITELIST = 6, | 191 DOWNLOADWHITELIST = 6, |
| 190 // See above comment. Leave 7 available. | 192 // See above comment. Leave 7 available. |
| 191 EXTENSIONBLACKLIST = 8, | 193 EXTENSIONBLACKLIST = 8, |
| 192 // See above comment. Leave 9 available. | 194 // See above comment. Leave 9 available. |
| 193 SIDEEFFECTFREEWHITELIST = 10, | 195 SIDEEFFECTFREEWHITELIST = 10, |
| 194 // See above comment. Leave 11 available. | 196 // See above comment. Leave 11 available. |
| 195 IPBLACKLIST = 12, | 197 IPBLACKLIST = 12, |
| 196 // See above comment. Leave 13 available. | 198 // See above comment. Leave 13 available. |
| 197 UNWANTEDURL = 14, | 199 UNWANTEDURL = 14, |
| 198 // See above comment. Leave 15 available. | 200 // See above comment. Leave 15 available. |
| 201 INCLUSIONWHITELIST = 16, |
| 202 // See above comment. Leave 17 available. |
| 199 }; | 203 }; |
| 200 | 204 |
| 201 // M40 experimental flag controls rollout of the UwS warning. | 205 // M40 experimental flag controls rollout of the UwS warning. |
| 202 enum UnwantedStatus { | 206 enum UnwantedStatus { |
| 203 UWS_OFF, | 207 UWS_OFF, |
| 204 UWS_ON_INVISIBLE, | 208 UWS_ON_INVISIBLE, |
| 205 UWS_ON | 209 UWS_ON |
| 206 }; | 210 }; |
| 207 | 211 |
| 208 // Maps a list name to ListType. | 212 // Maps a list name to ListType. |
| (...skipping 25 matching lines...) Expand all Loading... |
| 234 | 238 |
| 235 SBFullHash StringToSBFullHash(const std::string& hash_in); | 239 SBFullHash StringToSBFullHash(const std::string& hash_in); |
| 236 std::string SBFullHashToString(const SBFullHash& hash_out); | 240 std::string SBFullHashToString(const SBFullHash& hash_out); |
| 237 | 241 |
| 238 // Look up the status of the UwS warning. The default is off. | 242 // Look up the status of the UwS warning. The default is off. |
| 239 UnwantedStatus GetUnwantedTrialGroup(); | 243 UnwantedStatus GetUnwantedTrialGroup(); |
| 240 | 244 |
| 241 } // namespace safe_browsing_util | 245 } // namespace safe_browsing_util |
| 242 | 246 |
| 243 #endif // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_UTIL_H_ | 247 #endif // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_UTIL_H_ |
| OLD | NEW |