OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "chrome/browser/autofill/risk_util.h" | 5 #include "chrome/browser/autofill/risk_util.h" |
6 | 6 |
7 #include "base/base64.h" | 7 #include "base/base64.h" |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 #include "extensions/browser/app_window/app_window.h" | 27 #include "extensions/browser/app_window/app_window.h" |
28 #include "extensions/browser/app_window/native_app_window.h" | 28 #include "extensions/browser/app_window/native_app_window.h" |
29 #include "ui/base/base_window.h" | 29 #include "ui/base/base_window.h" |
30 #endif | 30 #endif |
31 | 31 |
32 namespace autofill { | 32 namespace autofill { |
33 | 33 |
34 namespace { | 34 namespace { |
35 | 35 |
36 void PassRiskData(const base::Callback<void(const std::string&)>& callback, | 36 void PassRiskData(const base::Callback<void(const std::string&)>& callback, |
37 scoped_ptr<risk::Fingerprint> fingerprint) { | 37 std::unique_ptr<risk::Fingerprint> fingerprint) { |
38 std::string proto_data, risk_data; | 38 std::string proto_data, risk_data; |
39 fingerprint->SerializeToString(&proto_data); | 39 fingerprint->SerializeToString(&proto_data); |
40 base::Base64Encode(proto_data, &risk_data); | 40 base::Base64Encode(proto_data, &risk_data); |
41 callback.Run(risk_data); | 41 callback.Run(risk_data); |
42 } | 42 } |
43 | 43 |
44 #if !defined(OS_ANDROID) | 44 #if !defined(OS_ANDROID) |
45 // Returns the containing window for the given |web_contents|. The containing | 45 // Returns the containing window for the given |web_contents|. The containing |
46 // window might be a browser window for a Chrome tab, or it might be an app | 46 // window might be a browser window for a Chrome tab, or it might be an app |
47 // window for a platform app. | 47 // window for a platform app. |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 g_browser_process->metrics_service()->GetInstallDate()); | 82 g_browser_process->metrics_service()->GetInstallDate()); |
83 | 83 |
84 risk::GetFingerprint(obfuscated_gaia_id, window_bounds, web_contents, | 84 risk::GetFingerprint(obfuscated_gaia_id, window_bounds, web_contents, |
85 version_info::GetVersionNumber(), charset, | 85 version_info::GetVersionNumber(), charset, |
86 accept_languages, install_time, | 86 accept_languages, install_time, |
87 g_browser_process->GetApplicationLocale(), | 87 g_browser_process->GetApplicationLocale(), |
88 GetUserAgent(), base::Bind(PassRiskData, callback)); | 88 GetUserAgent(), base::Bind(PassRiskData, callback)); |
89 } | 89 } |
90 | 90 |
91 } // namespace autofill | 91 } // namespace autofill |
OLD | NEW |