Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(675)

Unified Diff: components/password_manager/content/browser/content_password_manager_driver.cc

Issue 2680163006: Eliminate PasswordAutofillAgentConstructed() in mojo interface PasswordManagerDriver (Closed)
Patch Set: Address comments from vabr@ Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/password_manager/content/browser/content_password_manager_driver.cc
diff --git a/components/password_manager/content/browser/content_password_manager_driver.cc b/components/password_manager/content/browser/content_password_manager_driver.cc
index bdb9361bb0d4e59cc27bff2ced8df2865d9756d8..ebf591eba28d1eafbd05664bb1316650c43502fa 100644
--- a/components/password_manager/content/browser/content_password_manager_driver.cc
+++ b/components/password_manager/content/browser/content_password_manager_driver.cc
@@ -43,6 +43,19 @@ ContentPasswordManagerDriver::ContentPasswordManagerDriver(
// for this WebContents.
VisiblePasswordObserver::CreateForWebContents(
content::WebContents::FromRenderFrameHost(render_frame_host_));
+
+ // For some frames |this| may be instantiated before log manager creation, so
+ // here we can not send logging state to renderer process for them. For such
+ // cases, after the log manager got ready later,
+ // ContentPasswordManagerDriverFactory::RequestSendLoggingAvailability() will
+ // call ContentPasswordManagerDriver::SendLoggingAvailability() on |this| to
+ // do it actually.
+ if (client_->GetLogManager()) {
+ // Do not call the virtual method SendLoggingAvailability from a constructor
+ // here, inline its steps instead.
+ GetPasswordAutofillAgent()->SetLoggingState(
+ client_->GetLogManager()->IsLoggingActive());
+ }
}
ContentPasswordManagerDriver::~ContentPasswordManagerDriver() {
@@ -278,10 +291,6 @@ void ContentPasswordManagerDriver::ShowNotSecureWarning(
password_autofill_manager_.OnShowNotSecureWarning(text_direction, bounds);
}
-void ContentPasswordManagerDriver::PasswordAutofillAgentConstructed() {
- SendLoggingAvailability();
-}
-
void ContentPasswordManagerDriver::RecordSavePasswordProgress(
const std::string& log) {
client_->GetLogManager()->LogSavePasswordProgress(log);

Powered by Google App Engine
This is Rietveld 408576698