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

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

Issue 1929953002: Suppress the autofill password manager after a credential was saved via the API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add a comment Created 4 years, 7 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
« no previous file with comments | « no previous file | chrome/browser/password_manager/credential_manager_browsertest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/chrome_password_manager_client.h" 5 #include "chrome/browser/password_manager/chrome_password_manager_client.h"
6 6
7 #include <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 std::unique_ptr<password_manager::PasswordFormManager> form_to_save, 215 std::unique_ptr<password_manager::PasswordFormManager> form_to_save,
216 password_manager::CredentialSourceType type, 216 password_manager::CredentialSourceType type,
217 bool update_password) { 217 bool update_password) {
218 // Save password infobar and the password bubble prompts in case of 218 // Save password infobar and the password bubble prompts in case of
219 // "webby" URLs and do not prompt in case of "non-webby" URLS (e.g. file://). 219 // "webby" URLs and do not prompt in case of "non-webby" URLS (e.g. file://).
220 if (!BrowsingDataHelper::IsWebScheme( 220 if (!BrowsingDataHelper::IsWebScheme(
221 web_contents()->GetLastCommittedURL().scheme())) { 221 web_contents()->GetLastCommittedURL().scheme())) {
222 return false; 222 return false;
223 } 223 }
224 224
225 // Prevent the autofill password manager from prompting the second time.
226 if (type == password_manager::CredentialSourceType::CREDENTIAL_SOURCE_API)
227 password_manager_.DropFormManagers();
228
225 if (IsTheHotNewBubbleUIEnabled()) { 229 if (IsTheHotNewBubbleUIEnabled()) {
226 #if !BUILDFLAG(ANDROID_JAVA_UI) 230 #if !BUILDFLAG(ANDROID_JAVA_UI)
227 PasswordsClientUIDelegate* manage_passwords_ui_controller = 231 PasswordsClientUIDelegate* manage_passwords_ui_controller =
228 PasswordsClientUIDelegateFromWebContents(web_contents()); 232 PasswordsClientUIDelegateFromWebContents(web_contents());
229 if (update_password && IsUpdatePasswordUIEnabled()) { 233 if (update_password && IsUpdatePasswordUIEnabled()) {
230 manage_passwords_ui_controller->OnUpdatePasswordSubmitted( 234 manage_passwords_ui_controller->OnUpdatePasswordSubmitted(
231 std::move(form_to_save)); 235 std::move(form_to_save));
232 } else { 236 } else {
233 manage_passwords_ui_controller->OnPasswordSubmitted( 237 manage_passwords_ui_controller->OnPasswordSubmitted(
234 std::move(form_to_save)); 238 std::move(form_to_save));
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after
617 password_manager::mojom::CredentialManagerRequest request) { 621 password_manager::mojom::CredentialManagerRequest request) {
618 content::WebContents* web_contents = 622 content::WebContents* web_contents =
619 content::WebContents::FromRenderFrameHost(render_frame_host); 623 content::WebContents::FromRenderFrameHost(render_frame_host);
620 DCHECK(web_contents); 624 DCHECK(web_contents);
621 625
622 ChromePasswordManagerClient* instance = 626 ChromePasswordManagerClient* instance =
623 ChromePasswordManagerClient::FromWebContents(web_contents); 627 ChromePasswordManagerClient::FromWebContents(web_contents);
624 DCHECK(instance); 628 DCHECK(instance);
625 instance->credential_manager_impl_.BindRequest(std::move(request)); 629 instance->credential_manager_impl_.BindRequest(std::move(request));
626 } 630 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/password_manager/credential_manager_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698