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

Unified Diff: components/autofill/content/renderer/password_autofill_agent.cc

Issue 2915763003: [Password Manager] Show omnibox icon and anchored prompt once user start typing password (Closed)
Patch Set: Sent For Review Created 3 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: components/autofill/content/renderer/password_autofill_agent.cc
diff --git a/components/autofill/content/renderer/password_autofill_agent.cc b/components/autofill/content/renderer/password_autofill_agent.cc
index 88a79968f86a2868a3699832a1029aacd077d9e3..fa3ef083bafb3fe3d8a27f9d1ad04e734709bd0b 100644
--- a/components/autofill/content/renderer/password_autofill_agent.cc
+++ b/components/autofill/content/renderer/password_autofill_agent.cc
@@ -30,6 +30,7 @@
#include "components/autofill/core/common/autofill_util.h"
#include "components/autofill/core/common/form_field_data.h"
#include "components/autofill/core/common/password_form_fill_data.h"
+#include "components/password_manager/core/common/experiments.h"
#include "components/security_state/core/security_state.h"
#include "content/public/common/origin_util.h"
#include "content/public/renderer/document_state.h"
@@ -1769,13 +1770,23 @@ void PasswordAutofillAgent::ProvisionallySavePassword(
const blink::WebFormElement& form,
const blink::WebInputElement& input,
ProvisionallySaveRestriction restriction) {
- if (!password_form || (restriction == RESTRICTION_NON_EMPTY_PASSWORD &&
- password_form->password_value.empty() &&
- password_form->new_password_value.empty())) {
+ if (!password_form)
return;
- }
+ bool has_no_password = password_form->password_value.empty() &&
+ password_form->new_password_value.empty();
+ if (restriction == RESTRICTION_NON_EMPTY_PASSWORD && has_no_password)
+ return;
+
DCHECK(password_form && (!form.IsNull() || !input.IsNull()));
provisionally_saved_form_.Set(std::move(password_form), form, input);
+ if (password_manager::ManualFallbackForSavingEnabled()) {
vasilii 2017/07/21 12:48:20 Are you sure we need this check here? It introduce
kolos1 2017/07/24 15:33:30 The flag is removed.
+ if (!has_no_password) {
+ GetPasswordManagerDriver()->ShowManualFallback(
+ provisionally_saved_form_.password_form());
+ } else {
+ GetPasswordManagerDriver()->HideManualFallback();
+ }
+ }
}
const mojom::AutofillDriverPtr& PasswordAutofillAgent::GetAutofillDriver() {

Powered by Google App Engine
This is Rietveld 408576698