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_ |