| 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 #import "ios/chrome/browser/passwords/credential_manager.h" | 5 #import "ios/chrome/browser/passwords/credential_manager.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/ios/ios_util.h" | 9 #include "base/ios/ios_util.h" |
| 10 #import "base/ios/weak_nsobject.h" | 10 #import "base/ios/weak_nsobject.h" |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 std::unique_ptr<autofill::PasswordForm> form( | 197 std::unique_ptr<autofill::PasswordForm> form( |
| 198 password_manager::CreatePasswordFormFromCredentialInfo( | 198 password_manager::CreatePasswordFormFromCredentialInfo( |
| 199 CredentialInfoFromWebCredential(credential), page_url)); | 199 CredentialInfoFromWebCredential(credential), page_url)); |
| 200 form->skip_zero_click = !IsZeroClickAllowed(); | 200 form->skip_zero_click = !IsZeroClickAllowed(); |
| 201 | 201 |
| 202 // TODO(mkwst): This is a stub; we should be checking the PasswordStore to | 202 // TODO(mkwst): This is a stub; we should be checking the PasswordStore to |
| 203 // determine whether or not the credential exists, and calling UpdateLogin | 203 // determine whether or not the credential exists, and calling UpdateLogin |
| 204 // accordingly. | 204 // accordingly. |
| 205 form_manager_.reset( | 205 form_manager_.reset( |
| 206 new password_manager::CredentialManagerPasswordFormManager( | 206 new password_manager::CredentialManagerPasswordFormManager( |
| 207 client_, driver_->AsWeakPtr(), *form, this)); | 207 client_, driver_->AsWeakPtr(), |
| 208 *password_manager::CreateObservedPasswordFormFromOrigin(page_url), |
| 209 std::move(form), this)); |
| 208 } | 210 } |
| 209 | 211 |
| 210 void CredentialManager::SignedOut(int request_id, const GURL& source_url) { | 212 void CredentialManager::SignedOut(int request_id, const GURL& source_url) { |
| 211 // Invoked when the page invokes navigator.credentials.notifySignedOut, this | 213 // Invoked when the page invokes navigator.credentials.notifySignedOut, this |
| 212 // function notifies the PasswordStore that zero-click sign-in should be | 214 // function notifies the PasswordStore that zero-click sign-in should be |
| 213 // disabled for the current page origin. | 215 // disabled for the current page origin. |
| 214 DCHECK_GE(request_id, 0); | 216 DCHECK_GE(request_id, 0); |
| 215 | 217 |
| 216 // Requests from untrusted origins should be rejected. | 218 // Requests from untrusted origins should be rejected. |
| 217 GURL page_url; | 219 GURL page_url; |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 369 bool CredentialManager::GetUrlWithAbsoluteTrust(GURL* page_url) { | 371 bool CredentialManager::GetUrlWithAbsoluteTrust(GURL* page_url) { |
| 370 web::URLVerificationTrustLevel trust_level = | 372 web::URLVerificationTrustLevel trust_level = |
| 371 web::URLVerificationTrustLevel::kNone; | 373 web::URLVerificationTrustLevel::kNone; |
| 372 const GURL possibly_untrusted_url(web_state()->GetCurrentURL(&trust_level)); | 374 const GURL possibly_untrusted_url(web_state()->GetCurrentURL(&trust_level)); |
| 373 if (trust_level == web::URLVerificationTrustLevel::kAbsolute) { | 375 if (trust_level == web::URLVerificationTrustLevel::kAbsolute) { |
| 374 *page_url = possibly_untrusted_url; | 376 *page_url = possibly_untrusted_url; |
| 375 return true; | 377 return true; |
| 376 } | 378 } |
| 377 return false; | 379 return false; |
| 378 } | 380 } |
| OLD | NEW |