| Index: components/password_manager/content/browser/content_password_manager_driver_factory.cc
|
| diff --git a/components/password_manager/content/browser/content_password_manager_driver_factory.cc b/components/password_manager/content/browser/content_password_manager_driver_factory.cc
|
| index 53b47140bbd3db9cc6ac92fa15c4d55ccfc00cf8..809b6a81aebae2395f89a71421a9c0bd5f1cff76 100644
|
| --- a/components/password_manager/content/browser/content_password_manager_driver_factory.cc
|
| +++ b/components/password_manager/content/browser/content_password_manager_driver_factory.cc
|
| @@ -97,6 +97,30 @@ void ContentPasswordManagerDriverFactory::BindPasswordManagerDriver(
|
| driver->BindRequest(std::move(request));
|
| }
|
|
|
| +// static
|
| +void ContentPasswordManagerDriverFactory::BindSensitiveInputVisibilityService(
|
| + content::RenderFrameHost* render_frame_host,
|
| + blink::mojom::SensitiveInputVisibilityServiceRequest request) {
|
| + content::WebContents* web_contents =
|
| + content::WebContents::FromRenderFrameHost(render_frame_host);
|
| + if (!web_contents)
|
| + return;
|
| +
|
| + ContentPasswordManagerDriverFactory* factory =
|
| + ContentPasswordManagerDriverFactory::FromWebContents(web_contents);
|
| + // We try to bind to the driver, but if driver is not ready for now or totally
|
| + // not available for this render frame host, the request will be just dropped.
|
| + // This would cause the message pipe to be closed, which will raise a
|
| + // connection error on the peer side.
|
| + if (!factory)
|
| + return;
|
| +
|
| + ContentPasswordManagerDriver* driver =
|
| + factory->GetDriverForFrame(render_frame_host);
|
| + if (driver)
|
| + driver->BindSensitiveInputVisibilityServiceRequest(std::move(request));
|
| +}
|
| +
|
| ContentPasswordManagerDriver*
|
| ContentPasswordManagerDriverFactory::GetDriverForFrame(
|
| content::RenderFrameHost* render_frame_host) {
|
|
|