| 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 24 matching lines...) Expand all Loading... |
| 35 #include "content/public/browser/gpu_data_manager_observer.h" | 35 #include "content/public/browser/gpu_data_manager_observer.h" |
| 36 #include "content/public/browser/plugin_service.h" | 36 #include "content/public/browser/plugin_service.h" |
| 37 #include "content/public/browser/render_widget_host.h" | 37 #include "content/public/browser/render_widget_host.h" |
| 38 #include "content/public/browser/render_widget_host_view.h" | 38 #include "content/public/browser/render_widget_host_view.h" |
| 39 #include "content/public/browser/web_contents.h" | 39 #include "content/public/browser/web_contents.h" |
| 40 #include "content/public/common/geoposition.h" | 40 #include "content/public/common/geoposition.h" |
| 41 #include "content/public/common/webplugininfo.h" | 41 #include "content/public/common/webplugininfo.h" |
| 42 #include "gpu/config/gpu_info.h" | 42 #include "gpu/config/gpu_info.h" |
| 43 #include "third_party/WebKit/public/platform/WebRect.h" | 43 #include "third_party/WebKit/public/platform/WebRect.h" |
| 44 #include "third_party/WebKit/public/platform/WebScreenInfo.h" | 44 #include "third_party/WebKit/public/platform/WebScreenInfo.h" |
| 45 #include "ui/display/screen.h" |
| 45 #include "ui/gfx/geometry/rect.h" | 46 #include "ui/gfx/geometry/rect.h" |
| 46 #include "ui/gfx/screen.h" | |
| 47 | 47 |
| 48 using blink::WebScreenInfo; | 48 using blink::WebScreenInfo; |
| 49 | 49 |
| 50 namespace autofill { | 50 namespace autofill { |
| 51 namespace risk { | 51 namespace risk { |
| 52 | 52 |
| 53 namespace { | 53 namespace { |
| 54 | 54 |
| 55 const int32_t kFingerprinterVersion = 1; | 55 const int32_t kFingerprinterVersion = 1; |
| 56 | 56 |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 | 119 |
| 120 // This function writes | 120 // This function writes |
| 121 // (a) the number of screens, | 121 // (a) the number of screens, |
| 122 // (b) the primary display's screen size, | 122 // (b) the primary display's screen size, |
| 123 // (c) the screen's color depth, and | 123 // (c) the screen's color depth, and |
| 124 // (d) the size of the screen unavailable to web page content, | 124 // (d) the size of the screen unavailable to web page content, |
| 125 // i.e. the Taskbar size on Windows | 125 // i.e. the Taskbar size on Windows |
| 126 // into the |machine|. | 126 // into the |machine|. |
| 127 void AddScreenInfoToFingerprint(const WebScreenInfo& screen_info, | 127 void AddScreenInfoToFingerprint(const WebScreenInfo& screen_info, |
| 128 Fingerprint::MachineCharacteristics* machine) { | 128 Fingerprint::MachineCharacteristics* machine) { |
| 129 machine->set_screen_count(gfx::Screen::GetScreen()->GetNumDisplays()); | 129 machine->set_screen_count(display::Screen::GetScreen()->GetNumDisplays()); |
| 130 | 130 |
| 131 const gfx::Size screen_size = | 131 const gfx::Size screen_size = |
| 132 gfx::Screen::GetScreen()->GetPrimaryDisplay().GetSizeInPixel(); | 132 display::Screen::GetScreen()->GetPrimaryDisplay().GetSizeInPixel(); |
| 133 machine->mutable_screen_size()->set_width(screen_size.width()); | 133 machine->mutable_screen_size()->set_width(screen_size.width()); |
| 134 machine->mutable_screen_size()->set_height(screen_size.height()); | 134 machine->mutable_screen_size()->set_height(screen_size.height()); |
| 135 | 135 |
| 136 machine->set_screen_color_depth(screen_info.depth); | 136 machine->set_screen_color_depth(screen_info.depth); |
| 137 | 137 |
| 138 const gfx::Rect screen_rect(screen_info.rect); | 138 const gfx::Rect screen_rect(screen_info.rect); |
| 139 const gfx::Rect available_rect(screen_info.availableRect); | 139 const gfx::Rect available_rect(screen_info.availableRect); |
| 140 const gfx::Rect unavailable_rect = | 140 const gfx::Rect unavailable_rect = |
| 141 gfx::SubtractRects(screen_rect, available_rect); | 141 gfx::SubtractRects(screen_rect, available_rect); |
| 142 machine->mutable_unavailable_screen_size()->set_width( | 142 machine->mutable_unavailable_screen_size()->set_width( |
| (...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 472 host_view->GetRenderWidgetHost()->GetWebScreenInfo(&screen_info); | 472 host_view->GetRenderWidgetHost()->GetWebScreenInfo(&screen_info); |
| 473 | 473 |
| 474 internal::GetFingerprintInternal( | 474 internal::GetFingerprintInternal( |
| 475 obfuscated_gaia_id, window_bounds, content_bounds, screen_info, version, | 475 obfuscated_gaia_id, window_bounds, content_bounds, screen_info, version, |
| 476 charset, accept_languages, install_time, app_locale, user_agent, | 476 charset, accept_languages, install_time, app_locale, user_agent, |
| 477 base::TimeDelta::FromSeconds(kTimeoutSeconds), callback); | 477 base::TimeDelta::FromSeconds(kTimeoutSeconds), callback); |
| 478 } | 478 } |
| 479 | 479 |
| 480 } // namespace risk | 480 } // namespace risk |
| 481 } // namespace autofill | 481 } // namespace autofill |
| OLD | NEW |