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

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

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.h
diff --git a/components/password_manager/content/browser/password_visibility_service.h b/components/password_manager/content/browser/password_visibility_service.h
new file mode 100644
index 0000000000000000000000000000000000000000..8305dbd3ac77dc844937b264c590b28730733990
--- /dev/null
+++ b/components/password_manager/content/browser/password_visibility_service.h
@@ -0,0 +1,47 @@
+// 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.
+
+#ifndef COMPONENTS_PASSWORD_MANAGER_CONTENT_BROWSER_PASSWORD_VISIBILITY_SERVICE_H_
+#define COMPONENTS_PASSWORD_MANAGER_CONTENT_BROWSER_PASSWORD_VISIBILITY_SERVICE_H_
+
+#include "base/macros.h"
+#include "mojo/public/cpp/bindings/binding_set.h"
+#include "third_party/WebKit/public/platform/modules/sensitive_input_visibility/sensitive_input_visibility_service.mojom.h"
+
+namespace content {
+class RenderFrameHost;
+class WebContents;
+}
+
+namespace password_manager {
+
+// There is one PasswordVisibilityService per RenderFrameHost.
+// The lifetime is managed by the PasswordVisibilityServiceFactory.
+class PasswordVisibilityService
+ : public blink::mojom::SensitiveInputVisibilityService {
+ public:
+ PasswordVisibilityService();
+ ~PasswordVisibilityService() override;
+
+ // Gets the service for |render_frame_host|.
+ static PasswordVisibilityService* GetForRenderFrameHost(
+ content::RenderFrameHost* render_frame_host);
+
+ void BindRequest(
+ blink::mojom::SensitiveInputVisibilityServiceRequest request);
+
+ // blink::mojom::SensitiveInputVisibility:
+ void PasswordFieldVisible() override;
+
+ private:
+ mojo::BindingSet<blink::mojom::SensitiveInputVisibilityService> bindings_;
+
+ base::WeakPtrFactory<PasswordVisibilityService> weak_factory_;
+
+ DISALLOW_COPY_AND_ASSIGN(PasswordVisibilityService);
+};
+
+} // namespace password_manager
+
+#endif // COMPONENTS_PASSWORD_MANAGER_CONTENT_BROWSER_PASSWORD_VISIBILITY_SERVICE_H_

Powered by Google App Engine
This is Rietveld 408576698