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_manager_delegate.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 WebKit { 37 struct WebScreenInfo; 38 } 39 40 namespace autofill { 41 namespace risk { 42 43 class Fingerprint; 44 45 // Asynchronously calls |callback| with statistics that, collectively, provide a 46 // unique fingerprint for this (machine, user) pair, used for fraud prevention. 47 // |obfuscated_gaia_id| is an obfuscated user id for Google's authentication 48 // system. |window_bounds| should be the bounds of the containing Chrome window. 49 // |web_contents| should be the host for the page the user is interacting with. 50 // |version| is the version number of the application. |charset| is the default 51 // character set. |accept_languages| is the Accept-Languages setting. 52 // |install_time| is the absolute time of installation. 53 void GetFingerprint( 54 uint64 obfuscated_gaia_id, 55 const gfx::Rect& window_bounds, 56 const content::WebContents& web_contents, 57 const std::string& version, 58 const std::string& charset, 59 const std::string& accept_languages, 60 const base::Time& install_time, 61 DialogType dialog_type, 62 const std::string& app_locale, 63 const base::Callback<void(scoped_ptr<Fingerprint>)>& callback); 64 65 } // namespace risk 66 } // namespace autofill 67 68 #endif // COMPONENTS_AUTOFILL_CONTENT_BROWSER_RISK_FINGERPRINT_H_ 69