Skip to content

Commit

Permalink
[Password Manager] Minor cleanups
Browse files Browse the repository at this point in the history
Bug: 725883
Change-Id: I37a70c83dc47011995e24ac972cc81a3c8a7377a
Reviewed-on: https://chromium-review.googlesource.com/620487
Commit-Queue: Maxim Kolosovskiy <kolos@chromium.org>
Reviewed-by: Maxim Kolosovskiy <kolos@chromium.org>
Cr-Commit-Position: refs/heads/master@{#495627}
  • Loading branch information
Dominic Battre authored and Commit Bot committed Aug 18, 2017
1 parent 76106a4 commit 3751e40
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions chrome/browser/password_manager/password_manager_test_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,12 @@ class BubbleObserver {
public:
explicit BubbleObserver(content::WebContents* web_contents);

// Checks if the save prompt is being currently available due to both manual
// Checks if the save prompt is being currently available due to either manual
// fallback or successful login.
bool IsSavePromptAvailable() const;

// Checks if the update prompt is being currently available due to both manual
// fallback or successful login.
// Checks if the update prompt is being currently available due to either
// manual fallback or successful login.
bool IsUpdatePromptAvailable() const;

// Checks if the save prompt was shown automatically.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1807,14 +1807,14 @@ void PasswordAutofillAgent::ProvisionallySavePassword(
ProvisionallySaveRestriction restriction) {
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)
bool has_password = !password_form->password_value.empty() ||
!password_form->new_password_value.empty();
if (restriction == RESTRICTION_NON_EMPTY_PASSWORD && !has_password)
return;

DCHECK(password_form && (!form.IsNull() || !input.IsNull()));
provisionally_saved_form_.Set(std::move(password_form), form, input);
if (!has_no_password) {
if (has_password) {
GetPasswordManagerDriver()->ShowManualFallbackForSaving(
provisionally_saved_form_.password_form());
} else {
Expand Down

0 comments on commit 3751e40

Please sign in to comment.