| 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 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 std::unique_ptr<autofill::PasswordForm> form( | 198 std::unique_ptr<autofill::PasswordForm> form( |
| 199 password_manager::CreatePasswordFormFromCredentialInfo( | 199 password_manager::CreatePasswordFormFromCredentialInfo( |
| 200 CredentialInfoFromWebCredential(credential), page_url)); | 200 CredentialInfoFromWebCredential(credential), page_url)); |
| 201 form->skip_zero_click = !IsZeroClickAllowed(); | 201 form->skip_zero_click = !IsZeroClickAllowed(); |
| 202 | 202 |
| 203 // TODO(mkwst): This is a stub; we should be checking the PasswordStore to | 203 // TODO(mkwst): This is a stub; we should be checking the PasswordStore to |
| 204 // determine whether or not the credential exists, and calling UpdateLogin | 204 // determine whether or not the credential exists, and calling UpdateLogin |
| 205 // accordingly. | 205 // accordingly. |
| 206 form_manager_.reset( | 206 form_manager_.reset( |
| 207 new password_manager::CredentialManagerPasswordFormManager( | 207 new password_manager::CredentialManagerPasswordFormManager( |
| 208 client_, driver_->AsWeakPtr(), *form, this)); | 208 client_, driver_->AsWeakPtr(), |
| 209 *password_manager::CreateObservedPasswordFormFromOrigin(page_url), |
| 210 std::move(form), this)); |
| 209 } | 211 } |
| 210 | 212 |
| 211 void CredentialManager::SignedOut(int request_id, const GURL& source_url) { | 213 void CredentialManager::SignedOut(int request_id, const GURL& source_url) { |
| 212 // Invoked when the page invokes navigator.credentials.notifySignedOut, this | 214 // Invoked when the page invokes navigator.credentials.notifySignedOut, this |
| 213 // function notifies the PasswordStore that zero-click sign-in should be | 215 // function notifies the PasswordStore that zero-click sign-in should be |
| 214 // disabled for the current page origin. | 216 // disabled for the current page origin. |
| 215 DCHECK_GE(request_id, 0); | 217 DCHECK_GE(request_id, 0); |
| 216 | 218 |
| 217 // Requests from untrusted origins should be rejected. | 219 // Requests from untrusted origins should be rejected. |
| 218 GURL page_url; | 220 GURL page_url; |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 377 bool CredentialManager::GetUrlWithAbsoluteTrust(GURL* page_url) { | 379 bool CredentialManager::GetUrlWithAbsoluteTrust(GURL* page_url) { |
| 378 web::URLVerificationTrustLevel trust_level = | 380 web::URLVerificationTrustLevel trust_level = |
| 379 web::URLVerificationTrustLevel::kNone; | 381 web::URLVerificationTrustLevel::kNone; |
| 380 const GURL possibly_untrusted_url(web_state()->GetCurrentURL(&trust_level)); | 382 const GURL possibly_untrusted_url(web_state()->GetCurrentURL(&trust_level)); |
| 381 if (trust_level == web::URLVerificationTrustLevel::kAbsolute) { | 383 if (trust_level == web::URLVerificationTrustLevel::kAbsolute) { |
| 382 *page_url = possibly_untrusted_url; | 384 *page_url = possibly_untrusted_url; |
| 383 return true; | 385 return true; |
| 384 } | 386 } |
| 385 return false; | 387 return false; |
| 386 } | 388 } |
| OLD | NEW |