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( ...@@ -408,10 +408,7 @@ void PasswordsPrivateDelegateImpl::MovePasswordToAccount(
int id, int id,
content::WebContents* web_contents) { content::WebContents* web_contents) {
auto* client = ChromePasswordManagerClient::FromWebContents(web_contents); auto* client = ChromePasswordManagerClient::FromWebContents(web_contents);
// TODO(victorvianna): Use a DCHECK instead. DCHECK(client);
if (!client)
return;
if (const std::string* sort_key = password_id_generator_.TryGetKey(id)) if (const std::string* sort_key = password_id_generator_.TryGetKey(id))
password_manager_presenter_->MovePasswordToAccountStore(*sort_key, client); password_manager_presenter_->MovePasswordToAccountStore(*sort_key, client);
} }
...@@ -460,8 +457,7 @@ void PasswordsPrivateDelegateImpl::SetAccountStorageOptIn( ...@@ -460,8 +457,7 @@ void PasswordsPrivateDelegateImpl::SetAccountStorageOptIn(
bool opt_in, bool opt_in,
content::WebContents* web_contents) { content::WebContents* web_contents) {
auto* client = ChromePasswordManagerClient::FromWebContents(web_contents); auto* client = ChromePasswordManagerClient::FromWebContents(web_contents);
if (!client) DCHECK(client);
return;
if (opt_in == if (opt_in ==
client->GetPasswordFeatureManager()->IsOptedInForAccountStorage()) { client->GetPasswordFeatureManager()->IsOptedInForAccountStorage()) {
return; return;
......
...@@ -56,10 +56,8 @@ void UpdateAllFormManagers(Profile* profile) { ...@@ -56,10 +56,8 @@ void UpdateAllFormManagers(Profile* profile) {
TabStripModel* tabs = browser->tab_strip_model(); TabStripModel* tabs = browser->tab_strip_model();
for (int index = 0; index < tabs->count(); index++) { for (int index = 0; index < tabs->count(); index++) {
content::WebContents* web_contents = tabs->GetWebContentsAt(index); content::WebContents* web_contents = tabs->GetWebContentsAt(index);
ChromePasswordManagerClient* client = ChromePasswordManagerClient::FromWebContents(web_contents)
ChromePasswordManagerClient::FromWebContents(web_contents); ->UpdateFormManagers();
if (client)
client->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