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

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

Issue 861103002: Credentials chooser UI for Android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebaised on top of master. Created 5 years, 10 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
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
vabr (Chromium) 2015/02/04 08:43:07 2015
melandory 2015/02/04 15:58:49 Done.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/password_manager/account_chooser_infobar_delegate_andro id.h"
6
7 #include <cstddef>
vabr (Chromium) 2015/02/04 08:43:07 Please go through the #includes and check which of
melandory 2015/02/04 15:58:49 Done.
8
9 #include "chrome/browser/android/chromium_application.h"
10 #include "chrome/grit/generated_resources.h"
11 #include "chrome/grit/theme_resources.h"
12 #include "components/autofill/core/common/password_form.h"
13 #include "components/password_manager/content/common/credential_manager_types.h"
14 #include "ui/base/l10n/l10n_util.h"
15
16 AccountChooserInfoBarDelegateAndroid::AccountChooserInfoBarDelegateAndroid(
17 ManagePasswordsUIController* ui_controller)
18 : ui_controller_(ui_controller) {
19 }
20
21 void AccountChooserInfoBarDelegateAndroid::choose_credential(
22 unsigned int credential_index,
23 password_manager::CredentialType credential_type) {
24 autofill::PasswordForm* form = new autofill::PasswordForm();
vabr (Chromium) 2015/02/04 08:43:07 Please use scoped_vector to hold the allocated for
melandory 2015/02/04 15:58:49 Actually, I do not need to allocate form. Done.
25 if (credential_type ==
26 password_manager::CredentialType::CREDENTIAL_TYPE_LOCAL) {
27 if (credential_index < ui_controller_->local_credentials_forms().size()) {
28 form = ui_controller_->local_credentials_forms()[credential_index];
vabr (Chromium) 2015/02/04 08:43:07 Is this a memory leak? (Also line 34.)
melandory 2015/02/04 15:58:49 Done.
29 }
30 } else if (credential_type ==
31 password_manager::CredentialType::CREDENTIAL_TYPE_FEDERATED) {
32 if (credential_index <
33 ui_controller_->federated_credentials_forms().size()) {
34 form = ui_controller_->federated_credentials_forms()[credential_index];
35 }
36 }
37
38 ui_controller_->ChooseCredential(*form, credential_type);
vabr (Chromium) 2015/02/04 08:43:07 Is this a memory leak?
melandory 2015/02/04 15:58:49 Done.
39 }
40
41 AccountChooserInfoBarDelegateAndroid*
42 AccountChooserInfoBarDelegateAndroid::AsAccountChooserInfoBarDelegateAndroid() {
43 return this;
44 }
45
46 infobars::InfoBarDelegate::Type
47 AccountChooserInfoBarDelegateAndroid::GetInfoBarType() const {
48 return PAGE_ACTION_TYPE;
49 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698