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 <memory> |
| 8 |
7 #include "base/base64.h" | 9 #include "base/base64.h" |
8 #include "base/callback.h" | 10 #include "base/callback.h" |
9 #include "base/time/time.h" | 11 #include "base/time/time.h" |
10 #include "build/build_config.h" | 12 #include "build/build_config.h" |
11 #include "chrome/browser/apps/app_window_registry_util.h" | 13 #include "chrome/browser/apps/app_window_registry_util.h" |
12 #include "chrome/browser/browser_process.h" | 14 #include "chrome/browser/browser_process.h" |
13 #include "chrome/browser/profiles/profile.h" | 15 #include "chrome/browser/profiles/profile.h" |
14 #include "chrome/browser/ui/browser.h" | 16 #include "chrome/browser/ui/browser.h" |
15 #include "chrome/common/chrome_content_client.h" | 17 #include "chrome/common/chrome_content_client.h" |
16 #include "chrome/common/pref_names.h" | 18 #include "chrome/common/pref_names.h" |
(...skipping 10 matching lines...) Expand all Loading... |
27 #include "extensions/browser/app_window/app_window.h" | 29 #include "extensions/browser/app_window/app_window.h" |
28 #include "extensions/browser/app_window/native_app_window.h" | 30 #include "extensions/browser/app_window/native_app_window.h" |
29 #include "ui/base/base_window.h" | 31 #include "ui/base/base_window.h" |
30 #endif | 32 #endif |
31 | 33 |
32 namespace autofill { | 34 namespace autofill { |
33 | 35 |
34 namespace { | 36 namespace { |
35 | 37 |
36 void PassRiskData(const base::Callback<void(const std::string&)>& callback, | 38 void PassRiskData(const base::Callback<void(const std::string&)>& callback, |
37 scoped_ptr<risk::Fingerprint> fingerprint) { | 39 std::unique_ptr<risk::Fingerprint> fingerprint) { |
38 std::string proto_data, risk_data; | 40 std::string proto_data, risk_data; |
39 fingerprint->SerializeToString(&proto_data); | 41 fingerprint->SerializeToString(&proto_data); |
40 base::Base64Encode(proto_data, &risk_data); | 42 base::Base64Encode(proto_data, &risk_data); |
41 callback.Run(risk_data); | 43 callback.Run(risk_data); |
42 } | 44 } |
43 | 45 |
44 #if !defined(OS_ANDROID) | 46 #if !defined(OS_ANDROID) |
45 // Returns the containing window for the given |web_contents|. The containing | 47 // 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 | 48 // window might be a browser window for a Chrome tab, or it might be an app |
47 // window for a platform app. | 49 // 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()); | 84 g_browser_process->metrics_service()->GetInstallDate()); |
83 | 85 |
84 risk::GetFingerprint(obfuscated_gaia_id, window_bounds, web_contents, | 86 risk::GetFingerprint(obfuscated_gaia_id, window_bounds, web_contents, |
85 version_info::GetVersionNumber(), charset, | 87 version_info::GetVersionNumber(), charset, |
86 accept_languages, install_time, | 88 accept_languages, install_time, |
87 g_browser_process->GetApplicationLocale(), | 89 g_browser_process->GetApplicationLocale(), |
88 GetUserAgent(), base::Bind(PassRiskData, callback)); | 90 GetUserAgent(), base::Bind(PassRiskData, callback)); |
89 } | 91 } |
90 | 92 |
91 } // namespace autofill | 93 } // namespace autofill |
OLD | NEW |