| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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/ui/webui/settings/chromeos/fingerprint_handler.h" | 5 #include "chrome/browser/ui/webui/settings/chromeos/fingerprint_handler.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 base::Unretained(this))); | 109 base::Unretained(this))); |
| 110 } | 110 } |
| 111 | 111 |
| 112 void FingerprintHandler::OnJavascriptAllowed() {} | 112 void FingerprintHandler::OnJavascriptAllowed() {} |
| 113 | 113 |
| 114 void FingerprintHandler::OnJavascriptDisallowed() {} | 114 void FingerprintHandler::OnJavascriptDisallowed() {} |
| 115 | 115 |
| 116 void FingerprintHandler::OnRestarted() {} | 116 void FingerprintHandler::OnRestarted() {} |
| 117 | 117 |
| 118 void FingerprintHandler::OnEnrollScanDone(uint32_t scan_result, | 118 void FingerprintHandler::OnEnrollScanDone(uint32_t scan_result, |
| 119 bool enroll_session_complete) { | 119 bool enroll_session_complete, |
| 120 int32_t percent_complete) { |
| 120 AllowJavascript(); | 121 AllowJavascript(); |
| 121 auto scan_attempt = base::MakeUnique<base::DictionaryValue>(); | 122 auto scan_attempt = base::MakeUnique<base::DictionaryValue>(); |
| 122 scan_attempt->SetInteger("result", scan_result); | 123 scan_attempt->SetInteger("result", scan_result); |
| 123 scan_attempt->SetBoolean("isComplete", enroll_session_complete); | 124 scan_attempt->SetBoolean("isComplete", enroll_session_complete); |
| 125 scan_attempt->SetInteger("percentComplete", percent_complete); |
| 124 | 126 |
| 125 CallJavascriptFunction("cr.webUIListenerCallback", | 127 CallJavascriptFunction("cr.webUIListenerCallback", |
| 126 base::Value("on-fingerprint-scan-received"), | 128 base::Value("on-fingerprint-scan-received"), |
| 127 *scan_attempt); | 129 *scan_attempt); |
| 128 } | 130 } |
| 129 | 131 |
| 130 void FingerprintHandler::OnAuthScanDone( | 132 void FingerprintHandler::OnAuthScanDone( |
| 131 uint32_t scan_result, | 133 uint32_t scan_result, |
| 132 const std::unordered_map<std::string, std::vector<std::string>>& matches) { | 134 const std::unordered_map<std::string, std::vector<std::string>>& matches) { |
| 133 if (SessionManager::Get()->session_state() == SessionState::LOCKED) | 135 if (SessionManager::Get()->session_state() == SessionState::LOCKED) |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 321 weak_ptr_factory_.GetWeakPtr())); | 323 weak_ptr_factory_.GetWeakPtr())); |
| 322 } | 324 } |
| 323 | 325 |
| 324 void FingerprintHandler::OnEndCurrentAuthSession(bool success) { | 326 void FingerprintHandler::OnEndCurrentAuthSession(bool success) { |
| 325 if (!success) | 327 if (!success) |
| 326 LOG(ERROR) << "Failed to end current fingerprint authentication session."; | 328 LOG(ERROR) << "Failed to end current fingerprint authentication session."; |
| 327 } | 329 } |
| 328 | 330 |
| 329 } // namespace settings | 331 } // namespace settings |
| 330 } // namespace chromeos | 332 } // namespace chromeos |
| OLD | NEW |