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

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

Issue 2378503002: Observe visibility of password inputs, for HTTP-bad phase 1 (Closed)
Patch Set: fix browser-side binding Created 4 years, 3 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_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..26d743d80d21d28f6b2f3e92e4f32f8a62614f11 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->BindSensitiveInputVisibilityRequest(std::move(request));
+}
+
ContentPasswordManagerDriver*
ContentPasswordManagerDriverFactory::GetDriverForFrame(
content::RenderFrameHost* render_frame_host) {

Powered by Google App Engine
This is Rietveld 408576698