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

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

Issue 2697803002: [M57] Eliminate PasswordAutofillAgentConstructed() in mojo interface PasswordManagerDriver (Closed)
Patch Set: 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 c9d75761b69c5804e9b530da34aa7423d3db5463..a2b367aa9a9ce3f89b3b24f1f0542183301165c6 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() {
@@ -279,10 +292,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