| 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 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 // doesn't imply that the credential will be stored, just that it might be. | 187 // doesn't imply that the credential will be stored, just that it might be. |
| 188 // It isn't the page's concern to know whether the storage took place or not. | 188 // It isn't the page's concern to know whether the storage took place or not. |
| 189 ResolvePromise(request_id); | 189 ResolvePromise(request_id); |
| 190 | 190 |
| 191 // Do nothing if the password manager isn't active. | 191 // Do nothing if the password manager isn't active. |
| 192 if (!client_->IsSavingAndFillingEnabledForCurrentPage()) | 192 if (!client_->IsSavingAndFillingEnabledForCurrentPage()) |
| 193 return; | 193 return; |
| 194 | 194 |
| 195 // Store the signed-in credential so that the user can save it, if desired. | 195 // Store the signed-in credential so that the user can save it, if desired. |
| 196 // Prompting the user and saving are handled by the PasswordFormManager. | 196 // Prompting the user and saving are handled by the PasswordFormManager. |
| 197 scoped_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(), *form, this)); |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 369 bool CredentialManager::GetUrlWithAbsoluteTrust(GURL* page_url) { | 369 bool CredentialManager::GetUrlWithAbsoluteTrust(GURL* page_url) { |
| 370 web::URLVerificationTrustLevel trust_level = | 370 web::URLVerificationTrustLevel trust_level = |
| 371 web::URLVerificationTrustLevel::kNone; | 371 web::URLVerificationTrustLevel::kNone; |
| 372 const GURL possibly_untrusted_url(web_state()->GetCurrentURL(&trust_level)); | 372 const GURL possibly_untrusted_url(web_state()->GetCurrentURL(&trust_level)); |
| 373 if (trust_level == web::URLVerificationTrustLevel::kAbsolute) { | 373 if (trust_level == web::URLVerificationTrustLevel::kAbsolute) { |
| 374 *page_url = possibly_untrusted_url; | 374 *page_url = possibly_untrusted_url; |
| 375 return true; | 375 return true; |
| 376 } | 376 } |
| 377 return false; | 377 return false; |
| 378 } | 378 } |
| OLD | NEW |