1// Copyright (c) 2011 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4//
5// Client-side phishing features that are extracted by the browser, after
6// receiving a score from the renderer.
7
8#ifndef CHROME_BROWSER_SAFE_BROWSING_BROWSER_FEATURES_H_
9#define CHROME_BROWSER_SAFE_BROWSING_BROWSER_FEATURES_H_
10
11namespace safe_browsing {
12namespace features {
13
14// IMPORTANT: when adding new features, you must update kAllowedFeatures in
15// chrome/browser/safe_browsing/client_side_detection_service.cc if the feature
16// should be sent in sanitized pingbacks.
17//
18////////////////////////////////////////////////////
19// History features.
20////////////////////////////////////////////////////
21
22// Number of visits to that URL stored in the browser history.
23// Should always be an integer larger than 1 because by the time
24// we lookup the history the current URL should already be stored there.
25extern const char kUrlHistoryVisitCount[];
26
27// Number of times the URL was typed in the Omnibox.
28extern const char kUrlHistoryTypedCount[];
29
30// Number of times the URL was reached by clicking a link.
31extern const char kUrlHistoryLinkCount[];
32
33// Number of times URL was visited more than 24h ago.
34extern const char kUrlHistoryVisitCountMoreThan24hAgo[];
35
36// Number of user-visible visits to all URLs on the same host/port as
37// the URL for HTTP and HTTPs.
38extern const char kHttpHostVisitCount[];
39extern const char kHttpsHostVisitCount[];
40
41// Boolean feature which is true if the host was visited for the first
42// time more than 24h ago (only considers user-visible visits like above).
43extern const char kFirstHttpHostVisitMoreThan24hAgo[];
44extern const char kFirstHttpsHostVisitMoreThan24hAgo[];
45
46////////////////////////////////////////////////////
47// Browse features.
48////////////////////////////////////////////////////
49// Note that these features may have the following prefixes appended to them
50// that tell for which page type the feature pertains.
51extern const char kHostPrefix[];
52
53// Referrer
54extern const char kReferrer[];
55// True if the referrer was stripped because it is an SSL referrer.
56extern const char kHasSSLReferrer[];
57// Stores the page transition.  See: PageTransition.  We strip the qualifier.
58extern const char kPageTransitionType[];
59// True if this navigation is the first for this tab.
60extern const char kIsFirstNavigation[];
61// Feature that is set if the url from the navigation entry doesn't match the
62// url at the end of the redirect chain.
63extern const char kRedirectUrlMismatch[];
64// The redirect chain that leads to the named page.
65extern const char kRedirect[];
66// If a redirect is SSL, we will use this value instead of the actual redirect
67// so we don't leak any SSL sites.
68extern const char kSecureRedirectValue[];
69
70// Resource was fetched from a known bad IP address.
71extern const char kBadIpFetch[];
72
73// The HTTP status code for the main document.
74extern const char kHttpStatusCode[];
75
76// SafeBrowsing related featues.  Fields from the UnsafeResource if there is
77// any.
78extern const char kSafeBrowsingMaliciousUrl[];
79extern const char kSafeBrowsingOriginalUrl[];
80extern const char kSafeBrowsingIsSubresource[];
81extern const char kSafeBrowsingThreatType[];
82}  // namespace features
83}  // namespace safe_browsing
84
85#endif  // CHROME_BROWSER_SAFE_BROWSING_BROWSER_FEATURES_H_
86