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

Side by Side Diff: components/password_manager/core/browser/credential_manager_pending_request_task.cc

Issue 1832933002: Update the |skip_zero_click| flag of a credential when selected in the account chooser. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments 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 "components/password_manager/core/browser/credential_manager_pending_re quest_task.h" 5 #include "components/password_manager/core/browser/credential_manager_pending_re quest_task.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "components/autofill/core/common/password_form.h" 9 #include "components/autofill/core/common/password_form.h"
10 #include "components/password_manager/core/browser/affiliated_match_helper.h" 10 #include "components/password_manager/core/browser/affiliated_match_helper.h"
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 115
116 // Otherwise, return an empty credential if we're in zero-click-only mode 116 // Otherwise, return an empty credential if we're in zero-click-only mode
117 // or if the user chooses not to return a credential, and the credential the 117 // or if the user chooses not to return a credential, and the credential the
118 // user chooses if they pick one. 118 // user chooses if they pick one.
119 scoped_ptr<autofill::PasswordForm> potential_autosignin_form( 119 scoped_ptr<autofill::PasswordForm> potential_autosignin_form(
120 new autofill::PasswordForm(*local_results[0])); 120 new autofill::PasswordForm(*local_results[0]));
121 if (zero_click_only_ || 121 if (zero_click_only_ ||
122 !delegate_->client()->PromptUserToChooseCredentials( 122 !delegate_->client()->PromptUserToChooseCredentials(
123 std::move(local_results), std::move(federated_results), origin_, 123 std::move(local_results), std::move(federated_results), origin_,
124 base::Bind( 124 base::Bind(
125 &CredentialManagerPendingRequestTaskDelegate::SendCredential, 125 &CredentialManagerPendingRequestTaskDelegate::SendPasswordForm,
126 base::Unretained(delegate_), id_))) { 126 base::Unretained(delegate_), id_))) {
127 if (can_use_autosignin) { 127 if (can_use_autosignin) {
128 // The user had credentials, but either chose not to share them with the 128 // The user had credentials, but either chose not to share them with the
129 // site, or was prevented from doing so by lack of zero-click (or the 129 // site, or was prevented from doing so by lack of zero-click (or the
130 // first-run experience). So, notify the client that we could potentially 130 // first-run experience). So, notify the client that we could potentially
131 // have used zero-click; if the user signs in with the same form via 131 // have used zero-click; if the user signs in with the same form via
132 // autofill, we'll toggle the flag for them. 132 // autofill, we'll toggle the flag for them.
133 delegate_->client()->NotifyUserCouldBeAutoSignedIn( 133 delegate_->client()->NotifyUserCouldBeAutoSignedIn(
134 std::move(potential_autosignin_form)); 134 std::move(potential_autosignin_form));
135 } 135 }
136 136
137 delegate_->SendCredential(id_, CredentialInfo()); 137 delegate_->SendCredential(id_, CredentialInfo());
138 } 138 }
139 } 139 }
140 140
141 } // namespace password_manager 141 } // namespace password_manager
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698