| 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/password_manager/account_chooser_dialog_android.h" | 5 #include "chrome/browser/password_manager/account_chooser_dialog_android.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/android/jni_android.h" | 9 #include "base/android/jni_android.h" |
| 10 #include "base/android/jni_string.h" | 10 #include "base/android/jni_string.h" |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 } | 220 } |
| 221 | 221 |
| 222 void AccountChooserDialogAndroid::ChooseCredential( | 222 void AccountChooserDialogAndroid::ChooseCredential( |
| 223 size_t index, | 223 size_t index, |
| 224 password_manager::CredentialType type) { | 224 password_manager::CredentialType type) { |
| 225 using namespace password_manager; | 225 using namespace password_manager; |
| 226 if (type == CredentialType::CREDENTIAL_TYPE_EMPTY) { | 226 if (type == CredentialType::CREDENTIAL_TYPE_EMPTY) { |
| 227 passwords_data_.ChooseCredential(nullptr); | 227 passwords_data_.ChooseCredential(nullptr); |
| 228 return; | 228 return; |
| 229 } | 229 } |
| 230 DCHECK_EQ(CredentialType::CREDENTIAL_TYPE_PASSWORD, type); | |
| 231 const auto& credentials_forms = | 230 const auto& credentials_forms = |
| 232 (type == CredentialType::CREDENTIAL_TYPE_PASSWORD) | 231 (type == CredentialType::CREDENTIAL_TYPE_PASSWORD) |
| 233 ? local_credentials_forms() | 232 ? local_credentials_forms() |
| 234 : federated_credentials_forms(); | 233 : federated_credentials_forms(); |
| 235 if (index < credentials_forms.size()) { | 234 if (index < credentials_forms.size()) { |
| 236 passwords_data_.ChooseCredential(credentials_forms[index]); | 235 passwords_data_.ChooseCredential(credentials_forms[index]); |
| 237 } | 236 } |
| 238 } | 237 } |
| 239 | 238 |
| 240 bool RegisterAccountChooserDialogAndroid(JNIEnv* env) { | 239 bool RegisterAccountChooserDialogAndroid(JNIEnv* env) { |
| 241 return RegisterNativesImpl(env); | 240 return RegisterNativesImpl(env); |
| 242 } | 241 } |
| OLD | NEW |