OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |