Commit 26a7cabe authored by Victor Hugo Vianna Silva's avatar Victor Hugo Vianna Silva Committed by Commit Bot

Replace checks for PasswordManagerClient with DCHECK

This CL removes checks for the client from codepaths where it's supposed
to be non-null.

Bug: None
Change-Id: Ia85af01559410d8486d158841bbb7bbee8e38201
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2283311
Commit-Queue: Victor Vianna <victorvianna@google.com>
Reviewed-by: default avatarJan Wilken Dörrie <jdoerrie@chromium.org>
Cr-Commit-Position: refs/heads/master@{#786212}
parent 137ce471
......@@ -408,10 +408,7 @@ void PasswordsPrivateDelegateImpl::MovePasswordToAccount(
int id,
content::WebContents* web_contents) {
auto* client = ChromePasswordManagerClient::FromWebContents(web_contents);
// TODO(victorvianna): Use a DCHECK instead.
if (!client)
return;
DCHECK(client);
if (const std::string* sort_key = password_id_generator_.TryGetKey(id))
password_manager_presenter_->MovePasswordToAccountStore(*sort_key, client);
}
......@@ -460,8 +457,7 @@ void PasswordsPrivateDelegateImpl::SetAccountStorageOptIn(
bool opt_in,
content::WebContents* web_contents) {
auto* client = ChromePasswordManagerClient::FromWebContents(web_contents);
if (!client)
return;
DCHECK(client);
if (opt_in ==
client->GetPasswordFeatureManager()->IsOptedInForAccountStorage()) {
return;
......
......@@ -56,10 +56,8 @@ void UpdateAllFormManagers(Profile* profile) {
TabStripModel* tabs = browser->tab_strip_model();
for (int index = 0; index < tabs->count(); index++) {
content::WebContents* web_contents = tabs->GetWebContentsAt(index);
ChromePasswordManagerClient* client =
ChromePasswordManagerClient::FromWebContents(web_contents);
if (client)
client->UpdateFormManagers();
ChromePasswordManagerClient::FromWebContents(web_contents)
->UpdateFormManagers();
}
}
}
......
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