| 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/ui/passwords/manage_passwords_state.h" | 5 #include "chrome/browser/ui/passwords/manage_passwords_state.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "components/password_manager/core/browser/browser_save_password_progres
s_logger.h" | 9 #include "components/password_manager/core/browser/browser_save_password_progres
s_logger.h" |
| 10 #include "components/password_manager/core/browser/log_manager.h" | 10 #include "components/password_manager/core/browser/log_manager.h" |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 // passed into ::OnRequestCredentials as part of the |local_credentials| or | 222 // passed into ::OnRequestCredentials as part of the |local_credentials| or |
| 223 // |federated_credentials| lists (e.g. whether it is an existing credential | 223 // |federated_credentials| lists (e.g. whether it is an existing credential |
| 224 // saved for this origin, or whether we should synthesize a new | 224 // saved for this origin, or whether we should synthesize a new |
| 225 // FederatedCredential). | 225 // FederatedCredential). |
| 226 // | 226 // |
| 227 // If |credential_type| is federated, the credential MUST be returned as | 227 // If |credential_type| is federated, the credential MUST be returned as |
| 228 // a FederatedCredential in order to prevent password information leaking | 228 // a FederatedCredential in order to prevent password information leaking |
| 229 // cross-origin. | 229 // cross-origin. |
| 230 // | 230 // |
| 231 // If |credential_type| is local, the credential MIGHT be a PasswordCredential | 231 // If |credential_type| is local, the credential MIGHT be a PasswordCredential |
| 232 // or it MIGHT be a FederatedCredential. We inspect the |federation_url| | 232 // or it MIGHT be a FederatedCredential. We inspect the |federation_origin| |
| 233 // field to determine which we should return. | 233 // field to determine which we should return. |
| 234 // | 234 // |
| 235 // TODO(mkwst): Clean this up. It is confusing. | 235 // TODO(mkwst): Clean this up. It is confusing. |
| 236 password_manager::CredentialType type_to_return; | 236 password_manager::CredentialType type_to_return; |
| 237 if (credential_type == | 237 if (credential_type == |
| 238 password_manager::CredentialType::CREDENTIAL_TYPE_PASSWORD && | 238 password_manager::CredentialType::CREDENTIAL_TYPE_PASSWORD && |
| 239 form.federation_url.is_empty()) { | 239 form.federation_origin.unique()) { |
| 240 type_to_return = password_manager::CredentialType::CREDENTIAL_TYPE_PASSWORD; | 240 type_to_return = password_manager::CredentialType::CREDENTIAL_TYPE_PASSWORD; |
| 241 } else if (credential_type == | 241 } else if (credential_type == |
| 242 password_manager::CredentialType::CREDENTIAL_TYPE_EMPTY) { | 242 password_manager::CredentialType::CREDENTIAL_TYPE_EMPTY) { |
| 243 type_to_return = password_manager::CredentialType::CREDENTIAL_TYPE_EMPTY; | 243 type_to_return = password_manager::CredentialType::CREDENTIAL_TYPE_EMPTY; |
| 244 } else { | 244 } else { |
| 245 type_to_return = | 245 type_to_return = |
| 246 password_manager::CredentialType::CREDENTIAL_TYPE_FEDERATED; | 246 password_manager::CredentialType::CREDENTIAL_TYPE_FEDERATED; |
| 247 } | 247 } |
| 248 password_manager::CredentialInfo info = | 248 password_manager::CredentialInfo info = |
| 249 password_manager::CredentialInfo(form, type_to_return); | 249 password_manager::CredentialInfo(form, type_to_return); |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 DCHECK(client_); | 305 DCHECK(client_); |
| 306 if (client_->GetLogManager()->IsLoggingActive()) { | 306 if (client_->GetLogManager()->IsLoggingActive()) { |
| 307 password_manager::BrowserSavePasswordProgressLogger logger( | 307 password_manager::BrowserSavePasswordProgressLogger logger( |
| 308 client_->GetLogManager()); | 308 client_->GetLogManager()); |
| 309 logger.LogNumber( | 309 logger.LogNumber( |
| 310 autofill::SavePasswordProgressLogger::STRING_NEW_UI_STATE, | 310 autofill::SavePasswordProgressLogger::STRING_NEW_UI_STATE, |
| 311 state); | 311 state); |
| 312 } | 312 } |
| 313 state_ = state; | 313 state_ = state; |
| 314 } | 314 } |
| OLD | NEW |