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 #include "components/autofill/browser/risk/fingerprint.h" | 5 #include "components/autofill/browser/risk/fingerprint.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/cpu.h" | 9 #include "base/cpu.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "base/strings/string_split.h" | 11 #include "base/strings/string_split.h" |
12 #include "base/sys_info.h" | 12 #include "base/sys_info.h" |
13 #include "base/time.h" | 13 #include "base/time.h" |
14 #include "base/utf_string_conversions.h" | 14 #include "base/utf_string_conversions.h" |
15 #include "base/values.h" | 15 #include "base/values.h" |
16 #include "components/autofill/browser/autofill_country.h" | |
16 #include "components/autofill/browser/risk/proto/fingerprint.pb.h" | 17 #include "components/autofill/browser/risk/proto/fingerprint.pb.h" |
17 #include "content/public/browser/content_browser_client.h" | |
18 #include "content/public/browser/font_list_async.h" | 18 #include "content/public/browser/font_list_async.h" |
19 #include "content/public/browser/gpu_data_manager.h" | 19 #include "content/public/browser/gpu_data_manager.h" |
20 #include "content/public/browser/gpu_data_manager_observer.h" | 20 #include "content/public/browser/gpu_data_manager_observer.h" |
21 #include "content/public/browser/plugin_service.h" | 21 #include "content/public/browser/plugin_service.h" |
22 #include "content/public/browser/render_widget_host.h" | 22 #include "content/public/browser/render_widget_host.h" |
23 #include "content/public/browser/render_widget_host_view.h" | 23 #include "content/public/browser/render_widget_host_view.h" |
24 #include "content/public/browser/web_contents.h" | 24 #include "content/public/browser/web_contents.h" |
25 #include "content/public/browser/web_contents_view.h" | 25 #include "content/public/browser/web_contents_view.h" |
26 #include "content/public/common/content_client.h" | 26 #include "content/public/common/content_client.h" |
27 #include "content/public/common/gpu_info.h" | 27 #include "content/public/common/gpu_info.h" |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
311 void FingerprintDataLoader::FillFingerprint() { | 311 void FingerprintDataLoader::FillFingerprint() { |
312 scoped_ptr<Fingerprint> fingerprint(new Fingerprint); | 312 scoped_ptr<Fingerprint> fingerprint(new Fingerprint); |
313 Fingerprint_MachineCharacteristics* machine = | 313 Fingerprint_MachineCharacteristics* machine = |
314 fingerprint->mutable_machine_characteristics(); | 314 fingerprint->mutable_machine_characteristics(); |
315 | 315 |
316 machine->set_operating_system_build(GetOperatingSystemVersion()); | 316 machine->set_operating_system_build(GetOperatingSystemVersion()); |
317 // We use the delta between the install time and the Unix epoch, in hours. | 317 // We use the delta between the install time and the Unix epoch, in hours. |
318 machine->set_browser_install_time_hours( | 318 machine->set_browser_install_time_hours( |
319 (install_time_ - base::Time::UnixEpoch()).InHours()); | 319 (install_time_ - base::Time::UnixEpoch()).InHours()); |
320 machine->set_utc_offset_ms(GetTimezoneOffset().InMilliseconds()); | 320 machine->set_utc_offset_ms(GetTimezoneOffset().InMilliseconds()); |
321 machine->set_browser_language( | 321 machine->set_browser_language(AutofillCountry::ApplicationLocale()); |
Ilya Sherman
2013/04/03 23:51:18
Can you use g_browser_process->GetApplicationLocal
| |
322 content::GetContentClient()->browser()->GetApplicationLocale()); | |
323 machine->set_charset(charset_); | 322 machine->set_charset(charset_); |
324 machine->set_user_agent(content::GetContentClient()->GetUserAgent()); | 323 machine->set_user_agent(content::GetUserAgent(GURL())); |
325 machine->set_ram(base::SysInfo::AmountOfPhysicalMemory()); | 324 machine->set_ram(base::SysInfo::AmountOfPhysicalMemory()); |
326 machine->set_browser_build(version_); | 325 machine->set_browser_build(version_); |
327 machine->set_browser_feature(DialogTypeToBrowserFeature(dialog_type_)); | 326 machine->set_browser_feature(DialogTypeToBrowserFeature(dialog_type_)); |
328 AddFontsToFingerprint(*fonts_, machine); | 327 AddFontsToFingerprint(*fonts_, machine); |
329 AddPluginsToFingerprint(plugins_, machine); | 328 AddPluginsToFingerprint(plugins_, machine); |
330 AddAcceptLanguagesToFingerprint(accept_languages_, machine); | 329 AddAcceptLanguagesToFingerprint(accept_languages_, machine); |
331 AddScreenInfoToFingerprint(screen_info_, machine); | 330 AddScreenInfoToFingerprint(screen_info_, machine); |
332 AddCpuInfoToFingerprint(machine); | 331 AddCpuInfoToFingerprint(machine); |
333 AddGpuInfoToFingerprint(machine); | 332 AddGpuInfoToFingerprint(machine); |
334 | 333 |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
403 // This class is responsible for freeing its own memory. | 402 // This class is responsible for freeing its own memory. |
404 new FingerprintDataLoader(gaia_id, window_bounds, content_bounds, screen_info, | 403 new FingerprintDataLoader(gaia_id, window_bounds, content_bounds, screen_info, |
405 version, charset, accept_languages, install_time, | 404 version, charset, accept_languages, install_time, |
406 dialog_type, callback); | 405 dialog_type, callback); |
407 } | 406 } |
408 | 407 |
409 } // namespace internal | 408 } // namespace internal |
410 | 409 |
411 } // namespace risk | 410 } // namespace risk |
412 } // namespace autofill | 411 } // namespace autofill |
OLD | NEW |