Commit 32b3c249 authored by Victor Hugo Vianna Silva's avatar Victor Hugo Vianna Silva Committed by Commit Bot

[PasswordManagerClient] Find Browser with WebContents instead of Profile

In a multi-window scenario, FindBrowserWithProfile has to find the last
active one. Since ChromePasswordManagerClient is per WebContents, its
browser can be directly retrieved using FindBrowserWithWebContents.

Bug: None
Change-Id: I8f1cb0c1fe9cf7f8f1a34115a59bdbaf15aa1bb4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2144145Reviewed-by: default avatarVasilii Sukhanov <vasilii@chromium.org>
Commit-Queue: Victor Vianna <victorvianna@google.com>
Cr-Commit-Position: refs/heads/master@{#759220}
parent fa2a0aa9
...@@ -575,7 +575,7 @@ void ChromePasswordManagerClient::TriggerReauthForAccount( ...@@ -575,7 +575,7 @@ void ChromePasswordManagerClient::TriggerReauthForAccount(
#if defined(OS_ANDROID) #if defined(OS_ANDROID)
std::move(reauth_callback).Run(ReauthSucceeded(false)); std::move(reauth_callback).Run(ReauthSucceeded(false));
#else // !defined(OS_ANDROID) #else // !defined(OS_ANDROID)
Browser* browser = chrome::FindBrowserWithProfile(profile_); Browser* browser = chrome::FindBrowserWithWebContents(web_contents());
if (!browser) { if (!browser) {
std::move(reauth_callback).Run(ReauthSucceeded(false)); std::move(reauth_callback).Run(ReauthSucceeded(false));
return; return;
...@@ -600,7 +600,7 @@ void ChromePasswordManagerClient::TriggerReauthForAccount( ...@@ -600,7 +600,7 @@ void ChromePasswordManagerClient::TriggerReauthForAccount(
void ChromePasswordManagerClient::TriggerSignIn() { void ChromePasswordManagerClient::TriggerSignIn() {
#if BUILDFLAG(ENABLE_DICE_SUPPORT) #if BUILDFLAG(ENABLE_DICE_SUPPORT)
Browser* browser = chrome::FindBrowserWithProfile(profile_); Browser* browser = chrome::FindBrowserWithWebContents(web_contents());
if (!browser) if (!browser)
return; return;
if (SigninViewController* signin_controller = if (SigninViewController* signin_controller =
......
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