Commit 4aa9217b authored by Victor Hugo Vianna Silva's avatar Victor Hugo Vianna Silva Committed by Commit Bot

Refactor: Rename ShowManualPasswordGenerationPopup and expand comment

The documentation is expanded to reflect that this is the callback
executed at the end of the manual (user-triggered) generation flow. The
method is renamed to ManualGenerationResultAvailable to match its
counterpart AutomaticGenerationAvailable and avoid confusion with
ShowPasswordGenerationPopup. The renaming is also justified by the fact
that on some platforms a dialog gets shown instead of popup.

Bug: 1060131
Change-Id: I147daae8fe3cb4b87be576c9841f87475ae3c63b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2144154Reviewed-by: default avatarVasilii Sukhanov <vasilii@chromium.org>
Commit-Queue: Victor Vianna <victorvianna@google.com>
Cr-Commit-Position: refs/heads/master@{#757845}
parent 1adfa546
...@@ -470,7 +470,7 @@ void ChromePasswordManagerClient::GeneratePassword() { ...@@ -470,7 +470,7 @@ void ChromePasswordManagerClient::GeneratePassword() {
// Using unretained pointer is safe because |this| outlives // Using unretained pointer is safe because |this| outlives
// ContentPasswordManagerDriver that holds the connection. // ContentPasswordManagerDriver that holds the connection.
content_driver->GeneratePassword(base::BindOnce( content_driver->GeneratePassword(base::BindOnce(
&ChromePasswordManagerClient::ShowManualPasswordGenerationPopup, &ChromePasswordManagerClient::ManualGenerationResultAvailable,
base::Unretained(this), base::AsWeakPtr(content_driver))); base::Unretained(this), base::AsWeakPtr(content_driver)));
} }
...@@ -1264,7 +1264,7 @@ bool ChromePasswordManagerClient::CanShowBubbleOnURL(const GURL& url) { ...@@ -1264,7 +1264,7 @@ bool ChromePasswordManagerClient::CanShowBubbleOnURL(const GURL& url) {
scheme != content::kChromeDevToolsScheme); scheme != content::kChromeDevToolsScheme);
} }
void ChromePasswordManagerClient::ShowManualPasswordGenerationPopup( void ChromePasswordManagerClient::ManualGenerationResultAvailable(
base::WeakPtr<password_manager::ContentPasswordManagerDriver> driver, base::WeakPtr<password_manager::ContentPasswordManagerDriver> driver,
const base::Optional< const base::Optional<
autofill::password_generation::PasswordGenerationUIData>& ui_data) { autofill::password_generation::PasswordGenerationUIData>& ui_data) {
......
...@@ -300,9 +300,10 @@ class ChromePasswordManagerClient ...@@ -300,9 +300,10 @@ class ChromePasswordManagerClient
// without custom sync passphrase. // without custom sync passphrase.
static bool ShouldAnnotateNavigationEntries(Profile* profile); static bool ShouldAnnotateNavigationEntries(Profile* profile);
// |ui_data| is empty in case the renderer failed to start manual generation. // Called back by the PasswordGenerationAgent when the manual generation flow
// In this case nothing should happen. // is completed. If |ui_data| is non-empty, will create a UI to display the
void ShowManualPasswordGenerationPopup( // generated password. Otherwise, nothing will happen.
void ManualGenerationResultAvailable(
base::WeakPtr<password_manager::ContentPasswordManagerDriver> driver, base::WeakPtr<password_manager::ContentPasswordManagerDriver> driver,
const base::Optional< const base::Optional<
autofill::password_generation::PasswordGenerationUIData>& ui_data); autofill::password_generation::PasswordGenerationUIData>& ui_data);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment