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/risk/proto/fingerprint.pb.h" | 16 #include "components/autofill/browser/risk/proto/fingerprint.pb.h" |
17 #include "content/public/browser/browser_thread.h" | 17 #include "content/public/browser/browser_thread.h" |
18 #include "content/public/browser/font_list_async.h" | 18 #include "content/public/browser/font_list_async.h" |
19 #include "content/public/browser/geolocation_provider.h" | 19 #include "content/public/browser/geolocation_provider.h" |
20 #include "content/public/browser/gpu_data_manager.h" | 20 #include "content/public/browser/gpu_data_manager.h" |
21 #include "content/public/browser/gpu_data_manager_observer.h" | 21 #include "content/public/browser/gpu_data_manager_observer.h" |
22 #include "content/public/browser/plugin_service.h" | 22 #include "content/public/browser/plugin_service.h" |
23 #include "content/public/browser/render_widget_host.h" | 23 #include "content/public/browser/render_widget_host.h" |
24 #include "content/public/browser/render_widget_host_view.h" | 24 #include "content/public/browser/render_widget_host_view.h" |
25 #include "content/public/browser/web_contents.h" | 25 #include "content/public/browser/web_contents.h" |
26 #include "content/public/browser/web_contents_view.h" | 26 #include "content/public/browser/web_contents_view.h" |
27 #include "content/public/common/content_client.h" | 27 #include "content/public/common/content_client.h" |
28 #include "content/public/common/geoposition.h" | 28 #include "content/public/common/geoposition.h" |
29 #include "content/public/common/gpu_info.h" | 29 #include "gpu/config/gpu_info.h" |
30 #include "third_party/WebKit/Source/Platform/chromium/public/WebRect.h" | 30 #include "third_party/WebKit/Source/Platform/chromium/public/WebRect.h" |
31 #include "third_party/WebKit/Source/Platform/chromium/public/WebScreenInfo.h" | 31 #include "third_party/WebKit/Source/Platform/chromium/public/WebScreenInfo.h" |
32 #include "ui/gfx/rect.h" | 32 #include "ui/gfx/rect.h" |
33 #include "ui/gfx/screen.h" | 33 #include "ui/gfx/screen.h" |
34 #include "webkit/plugins/webplugininfo.h" | 34 #include "webkit/plugins/webplugininfo.h" |
35 | 35 |
36 using WebKit::WebScreenInfo; | 36 using WebKit::WebScreenInfo; |
37 | 37 |
38 namespace autofill { | 38 namespace autofill { |
39 namespace risk { | 39 namespace risk { |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 | 152 |
153 // Writes info about the machine's CPU into the |machine|. | 153 // Writes info about the machine's CPU into the |machine|. |
154 void AddCpuInfoToFingerprint(Fingerprint_MachineCharacteristics* machine) { | 154 void AddCpuInfoToFingerprint(Fingerprint_MachineCharacteristics* machine) { |
155 base::CPU cpu; | 155 base::CPU cpu; |
156 machine->mutable_cpu()->set_vendor_name(cpu.vendor_name()); | 156 machine->mutable_cpu()->set_vendor_name(cpu.vendor_name()); |
157 machine->mutable_cpu()->set_brand(cpu.cpu_brand()); | 157 machine->mutable_cpu()->set_brand(cpu.cpu_brand()); |
158 } | 158 } |
159 | 159 |
160 // Writes info about the machine's GPU into the |machine|. | 160 // Writes info about the machine's GPU into the |machine|. |
161 void AddGpuInfoToFingerprint(Fingerprint_MachineCharacteristics* machine) { | 161 void AddGpuInfoToFingerprint(Fingerprint_MachineCharacteristics* machine) { |
162 const content::GPUInfo& gpu_info = | 162 const gpu::GPUInfo& gpu_info = |
163 content::GpuDataManager::GetInstance()->GetGPUInfo(); | 163 content::GpuDataManager::GetInstance()->GetGPUInfo(); |
164 DCHECK(gpu_info.finalized); | 164 DCHECK(gpu_info.finalized); |
165 | 165 |
166 Fingerprint_MachineCharacteristics_Graphics* graphics = | 166 Fingerprint_MachineCharacteristics_Graphics* graphics = |
167 machine->mutable_graphics_card(); | 167 machine->mutable_graphics_card(); |
168 graphics->set_vendor_id(gpu_info.gpu.vendor_id); | 168 graphics->set_vendor_id(gpu_info.gpu.vendor_id); |
169 graphics->set_device_id(gpu_info.gpu.device_id); | 169 graphics->set_device_id(gpu_info.gpu.device_id); |
170 graphics->set_driver_version(gpu_info.driver_version); | 170 graphics->set_driver_version(gpu_info.driver_version); |
171 graphics->set_driver_date(gpu_info.driver_date); | 171 graphics->set_driver_date(gpu_info.driver_date); |
172 | 172 |
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
476 // This class is responsible for freeing its own memory. | 476 // This class is responsible for freeing its own memory. |
477 new FingerprintDataLoader(gaia_id, window_bounds, content_bounds, screen_info, | 477 new FingerprintDataLoader(gaia_id, window_bounds, content_bounds, screen_info, |
478 version, charset, accept_languages, install_time, | 478 version, charset, accept_languages, install_time, |
479 dialog_type, app_locale, callback); | 479 dialog_type, app_locale, callback); |
480 } | 480 } |
481 | 481 |
482 } // namespace internal | 482 } // namespace internal |
483 | 483 |
484 } // namespace risk | 484 } // namespace risk |
485 } // namespace autofill | 485 } // namespace autofill |
OLD | NEW |