Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / components / autofill / content / browser / risk / fingerprint.h
1 // Copyright 2013 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 // Generates fingerprints appropriate for sending to the Google Wallet Risk
6 // engine, which is the fraud-detection engine used for purchases powered by
7 // Google Wallet.  A fingerprint encapsulates machine and user characteristics.
8 // Because much of the data is privacy-sensitive, fingerprints should only be
9 // generated with explicit user consent, including consent to gather geolocation
10 // data.
11
12 #ifndef COMPONENTS_AUTOFILL_CONTENT_BROWSER_RISK_FINGERPRINT_H_
13 #define COMPONENTS_AUTOFILL_CONTENT_BROWSER_RISK_FINGERPRINT_H_
14
15 #include <string>
16
17 #include "base/basictypes.h"
18 #include "base/callback_forward.h"
19 #include "base/memory/scoped_ptr.h"
20 #include "components/autofill/core/browser/autofill_client.h"
21
22 class PrefService;
23
24 namespace base {
25 class Time;
26 }
27
28 namespace content {
29 class WebContents;
30 }
31
32 namespace gfx {
33 class Rect;
34 }
35
36 namespace autofill {
37 namespace risk {
38
39 class Fingerprint;
40
41 // Asynchronously calls |callback| with statistics that, collectively, provide a
42 // unique fingerprint for this (machine, user) pair, used for fraud prevention.
43 // |obfuscated_gaia_id| is an obfuscated user id for Google's authentication
44 // system. |window_bounds| should be the bounds of the containing Chrome window.
45 // |web_contents| should be the host for the page the user is interacting with.
46 // |version| is the version number of the application. |charset| is the default
47 // character set. |accept_languages| is the Accept-Languages setting.
48 // |install_time| is the absolute time of installation.
49 void GetFingerprint(
50     uint64 obfuscated_gaia_id,
51     const gfx::Rect& window_bounds,
52     content::WebContents* web_contents,
53     const std::string& version,
54     const std::string& charset,
55     const std::string& accept_languages,
56     const base::Time& install_time,
57     const std::string& app_locale,
58     const std::string& user_agent,
59     const base::Callback<void(scoped_ptr<Fingerprint>)>& callback);
60
61 }  // namespace risk
62 }  // namespace autofill
63
64 #endif  // COMPONENTS_AUTOFILL_CONTENT_BROWSER_RISK_FINGERPRINT_H_