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> |
| 8 |
7 #include "base/android/jni_android.h" | 9 #include "base/android/jni_android.h" |
8 #include "base/android/jni_string.h" | 10 #include "base/android/jni_string.h" |
9 #include "base/android/scoped_java_ref.h" | 11 #include "base/android/scoped_java_ref.h" |
10 #include "base/macros.h" | 12 #include "base/macros.h" |
11 #include "chrome/browser/password_manager/chrome_password_manager_client.h" | 13 #include "chrome/browser/password_manager/chrome_password_manager_client.h" |
12 #include "chrome/browser/password_manager/credential_android.h" | 14 #include "chrome/browser/password_manager/credential_android.h" |
13 #include "chrome/browser/profiles/profile.h" | 15 #include "chrome/browser/profiles/profile.h" |
14 #include "chrome/browser/sync/profile_sync_service_factory.h" | 16 #include "chrome/browser/sync/profile_sync_service_factory.h" |
15 #include "chrome/browser/ui/passwords/account_avatar_fetcher.h" | 17 #include "chrome/browser/ui/passwords/account_avatar_fetcher.h" |
16 #include "chrome/browser/ui/passwords/manage_passwords_view_utils.h" | 18 #include "chrome/browser/ui/passwords/manage_passwords_view_utils.h" |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 | 105 |
104 AccountChooserDialogAndroid::AccountChooserDialogAndroid( | 106 AccountChooserDialogAndroid::AccountChooserDialogAndroid( |
105 content::WebContents* web_contents, | 107 content::WebContents* web_contents, |
106 ScopedVector<autofill::PasswordForm> local_credentials, | 108 ScopedVector<autofill::PasswordForm> local_credentials, |
107 ScopedVector<autofill::PasswordForm> federated_credentials, | 109 ScopedVector<autofill::PasswordForm> federated_credentials, |
108 const GURL& origin, | 110 const GURL& origin, |
109 const ManagePasswordsState::CredentialsCallback& callback) | 111 const ManagePasswordsState::CredentialsCallback& callback) |
110 : web_contents_(web_contents) { | 112 : web_contents_(web_contents) { |
111 passwords_data_.set_client( | 113 passwords_data_.set_client( |
112 ChromePasswordManagerClient::FromWebContents(web_contents_)); | 114 ChromePasswordManagerClient::FromWebContents(web_contents_)); |
113 passwords_data_.OnRequestCredentials(local_credentials.Pass(), | 115 passwords_data_.OnRequestCredentials( |
114 federated_credentials.Pass(), origin); | 116 std::move(local_credentials), std::move(federated_credentials), origin); |
115 passwords_data_.set_credentials_callback(callback); | 117 passwords_data_.set_credentials_callback(callback); |
116 } | 118 } |
117 | 119 |
118 AccountChooserDialogAndroid::~AccountChooserDialogAndroid() {} | 120 AccountChooserDialogAndroid::~AccountChooserDialogAndroid() {} |
119 | 121 |
120 void AccountChooserDialogAndroid::ShowDialog() { | 122 void AccountChooserDialogAndroid::ShowDialog() { |
121 JNIEnv* env = AttachCurrentThread(); | 123 JNIEnv* env = AttachCurrentThread(); |
122 bool is_smartlock_branding_enabled = | 124 bool is_smartlock_branding_enabled = |
123 password_bubble_experiment::IsSmartLockBrandingEnabled( | 125 password_bubble_experiment::IsSmartLockBrandingEnabled( |
124 ProfileSyncServiceFactory::GetForProfile( | 126 ProfileSyncServiceFactory::GetForProfile( |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 ? local_credentials_forms() | 212 ? local_credentials_forms() |
211 : federated_credentials_forms(); | 213 : federated_credentials_forms(); |
212 if (index < credentials_forms.size()) { | 214 if (index < credentials_forms.size()) { |
213 passwords_data_.ChooseCredential(*credentials_forms[index], type); | 215 passwords_data_.ChooseCredential(*credentials_forms[index], type); |
214 } | 216 } |
215 } | 217 } |
216 | 218 |
217 bool RegisterAccountChooserDialogAndroid(JNIEnv* env) { | 219 bool RegisterAccountChooserDialogAndroid(JNIEnv* env) { |
218 return RegisterNativesImpl(env); | 220 return RegisterNativesImpl(env); |
219 } | 221 } |
OLD | NEW |