OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 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 // Generating a fingerprint consists of two major steps: | 5 // Generating a fingerprint consists of two major steps: |
6 // (1) Gather all the necessary data. | 6 // (1) Gather all the necessary data. |
7 // (2) Write it into a protocol buffer. | 7 // (2) Write it into a protocol buffer. |
8 // | 8 // |
9 // Step (2) is as simple as it sounds -- it's really just a matter of copying | 9 // Step (2) is as simple as it sounds -- it's really just a matter of copying |
10 // data. Step (1) requires waiting on several asynchronous callbacks, which are | 10 // data. Step (1) requires waiting on several asynchronous callbacks, which are |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 base::SysInfo::OperatingSystemVersion(); | 79 base::SysInfo::OperatingSystemVersion(); |
80 } | 80 } |
81 | 81 |
82 // Adds the list of |fonts| to the |machine|. | 82 // Adds the list of |fonts| to the |machine|. |
83 void AddFontsToFingerprint(const base::ListValue& fonts, | 83 void AddFontsToFingerprint(const base::ListValue& fonts, |
84 Fingerprint::MachineCharacteristics* machine) { | 84 Fingerprint::MachineCharacteristics* machine) { |
85 for (const auto& it : fonts) { | 85 for (const auto& it : fonts) { |
86 // Each item in the list is a two-element list such that the first element | 86 // Each item in the list is a two-element list such that the first element |
87 // is the font family and the second is the font name. | 87 // is the font family and the second is the font name. |
88 const base::ListValue* font_description = NULL; | 88 const base::ListValue* font_description = NULL; |
89 bool success = it->GetAsList(&font_description); | 89 bool success = it.GetAsList(&font_description); |
90 DCHECK(success); | 90 DCHECK(success); |
91 | 91 |
92 std::string font_name; | 92 std::string font_name; |
93 success = font_description->GetString(1, &font_name); | 93 success = font_description->GetString(1, &font_name); |
94 DCHECK(success); | 94 DCHECK(success); |
95 | 95 |
96 machine->add_font(font_name); | 96 machine->add_font(font_name); |
97 } | 97 } |
98 } | 98 } |
99 | 99 |
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
476 host_view->GetRenderWidgetHost()->GetScreenInfo(&screen_info); | 476 host_view->GetRenderWidgetHost()->GetScreenInfo(&screen_info); |
477 | 477 |
478 internal::GetFingerprintInternal( | 478 internal::GetFingerprintInternal( |
479 obfuscated_gaia_id, window_bounds, content_bounds, screen_info, version, | 479 obfuscated_gaia_id, window_bounds, content_bounds, screen_info, version, |
480 charset, accept_languages, install_time, app_locale, user_agent, | 480 charset, accept_languages, install_time, app_locale, user_agent, |
481 base::TimeDelta::FromSeconds(kTimeoutSeconds), callback); | 481 base::TimeDelta::FromSeconds(kTimeoutSeconds), callback); |
482 } | 482 } |
483 | 483 |
484 } // namespace risk | 484 } // namespace risk |
485 } // namespace autofill | 485 } // namespace autofill |
OLD | NEW |