Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(196)

Side by Side Diff: chrome/browser/password_manager/account_chooser_dialog_android.cc

Issue 1837043003: Add a title for the account chooser for one credential displayed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 AccountChooserDialogAndroid::~AccountChooserDialogAndroid() {} 121 AccountChooserDialogAndroid::~AccountChooserDialogAndroid() {}
122 122
123 void AccountChooserDialogAndroid::ShowDialog() { 123 void AccountChooserDialogAndroid::ShowDialog() {
124 JNIEnv* env = AttachCurrentThread(); 124 JNIEnv* env = AttachCurrentThread();
125 bool is_smartlock_branding_enabled = 125 bool is_smartlock_branding_enabled =
126 password_bubble_experiment::IsSmartLockUser( 126 password_bubble_experiment::IsSmartLockUser(
127 ProfileSyncServiceFactory::GetForProfile( 127 ProfileSyncServiceFactory::GetForProfile(
128 Profile::FromBrowserContext(web_contents_->GetBrowserContext()))); 128 Profile::FromBrowserContext(web_contents_->GetBrowserContext())));
129 base::string16 title; 129 base::string16 title;
130 gfx::Range title_link_range = gfx::Range(); 130 gfx::Range title_link_range = gfx::Range();
131 GetAccountChooserDialogTitleTextAndLinkRange(is_smartlock_branding_enabled, 131 GetAccountChooserDialogTitleTextAndLinkRange(
132 &title, &title_link_range); 132 is_smartlock_branding_enabled, local_credentials_forms().size() > 1,
133 &title, &title_link_range);
133 gfx::NativeWindow native_window = web_contents_->GetTopLevelNativeWindow(); 134 gfx::NativeWindow native_window = web_contents_->GetTopLevelNativeWindow();
134 size_t credential_array_size = 135 size_t credential_array_size =
135 local_credentials_forms().size() + federated_credentials_forms().size(); 136 local_credentials_forms().size() + federated_credentials_forms().size();
136 ScopedJavaLocalRef<jobjectArray> java_credentials_array = 137 ScopedJavaLocalRef<jobjectArray> java_credentials_array =
137 CreateNativeCredentialArray(env, credential_array_size); 138 CreateNativeCredentialArray(env, credential_array_size);
138 AddElementsToJavaCredentialArray( 139 AddElementsToJavaCredentialArray(
139 env, java_credentials_array, local_credentials_forms(), 140 env, java_credentials_array, local_credentials_forms(),
140 password_manager::CredentialType::CREDENTIAL_TYPE_PASSWORD); 141 password_manager::CredentialType::CREDENTIAL_TYPE_PASSWORD);
141 AddElementsToJavaCredentialArray( 142 AddElementsToJavaCredentialArray(
142 env, java_credentials_array, federated_credentials_forms(), 143 env, java_credentials_array, federated_credentials_forms(),
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 ? local_credentials_forms() 216 ? local_credentials_forms()
216 : federated_credentials_forms(); 217 : federated_credentials_forms();
217 if (index < credentials_forms.size()) { 218 if (index < credentials_forms.size()) {
218 passwords_data_.ChooseCredential(credentials_forms[index]); 219 passwords_data_.ChooseCredential(credentials_forms[index]);
219 } 220 }
220 } 221 }
221 222
222 bool RegisterAccountChooserDialogAndroid(JNIEnv* env) { 223 bool RegisterAccountChooserDialogAndroid(JNIEnv* env) {
223 return RegisterNativesImpl(env); 224 return RegisterNativesImpl(env);
224 } 225 }
OLDNEW
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | chrome/browser/ui/passwords/manage_passwords_view_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698