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

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

Issue 2378503002: Observe visibility of password inputs, for HTTP-bad phase 1 (Closed)
Patch Set: fix superclass createLayoutObject call Created 4 years, 2 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/password_visibility_service.cc
diff --git a/components/password_manager/content/browser/password_visibility_service.cc b/components/password_manager/content/browser/password_visibility_service.cc
new file mode 100644
index 0000000000000000000000000000000000000000..a32883622d930726cd31a30d4ce957126f9e0a2b
--- /dev/null
+++ b/components/password_manager/content/browser/password_visibility_service.cc
@@ -0,0 +1,37 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "components/password_manager/content/browser/password_visibility_service.h"
+
+#include "components/password_manager/content/browser/password_visibility_service_factory.h"
+#include "content/public/browser/render_frame_host.h"
+#include "content/public/browser/web_contents.h"
+
+namespace password_manager {
+
+PasswordVisibilityService::PasswordVisibilityService() : weak_factory_(this) {}
+
+PasswordVisibilityService::~PasswordVisibilityService() {}
+
+// static
+PasswordVisibilityService* PasswordVisibilityService::GetForRenderFrameHost(
+ content::RenderFrameHost* render_frame_host) {
+ PasswordVisibilityServiceFactory* factory =
+ PasswordVisibilityServiceFactory::FromWebContents(
+ content::WebContents::FromRenderFrameHost(render_frame_host));
+ return factory ? factory->GetServiceForFrame(render_frame_host) : nullptr;
+}
+
+void PasswordVisibilityService::BindRequest(
+ blink::mojom::SensitiveInputVisibilityServiceRequest request) {
+ bindings_.AddBinding(this, std::move(request));
+}
+
+void PasswordVisibilityService::PasswordFieldVisible() {
+ // TODO(estark): notify the WebContents that a password field was
+ // shown, which will downgrade the security UI
+ // appropriately. https://crbug.com/647560
+}
+
+} // namespace password_manager

Powered by Google App Engine
This is Rietveld 408576698