| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef COMPONENTS_PASSWORD_MANAGER_CONTENT_BROWSER_CONTENT_PASSWORD_MANAGER_DRI
VER_FACTORY_H_ | 5 #ifndef COMPONENTS_PASSWORD_MANAGER_CONTENT_BROWSER_CONTENT_PASSWORD_MANAGER_DRI
VER_FACTORY_H_ |
| 6 #define COMPONENTS_PASSWORD_MANAGER_CONTENT_BROWSER_CONTENT_PASSWORD_MANAGER_DRI
VER_FACTORY_H_ | 6 #define COMPONENTS_PASSWORD_MANAGER_CONTENT_BROWSER_CONTENT_PASSWORD_MANAGER_DRI
VER_FACTORY_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "base/supports_user_data.h" | 13 #include "base/supports_user_data.h" |
| 14 #include "components/autofill/content/common/autofill_driver.mojom.h" | 14 #include "components/autofill/content/common/autofill_driver.mojom.h" |
| 15 #include "components/password_manager/core/browser/password_autofill_manager.h" | 15 #include "components/password_manager/core/browser/password_autofill_manager.h" |
| 16 #include "components/password_manager/core/browser/password_generation_manager.h
" | 16 #include "components/password_manager/core/browser/password_generation_manager.h
" |
| 17 #include "components/password_manager/core/browser/password_manager.h" | 17 #include "components/password_manager/core/browser/password_manager.h" |
| 18 #include "components/password_manager/core/browser/password_manager_driver.h" | 18 #include "components/password_manager/core/browser/password_manager_driver.h" |
| 19 #include "content/public/browser/web_contents_observer.h" | 19 #include "content/public/browser/web_contents_observer.h" |
| 20 #include "services/service_manager/public/cpp/bind_source_info.h" |
| 20 #include "third_party/WebKit/public/platform/modules/sensitive_input_visibility/
sensitive_input_visibility_service.mojom.h" | 21 #include "third_party/WebKit/public/platform/modules/sensitive_input_visibility/
sensitive_input_visibility_service.mojom.h" |
| 21 | 22 |
| 22 namespace content { | 23 namespace content { |
| 23 class WebContents; | 24 class WebContents; |
| 24 } | 25 } |
| 25 | 26 |
| 26 namespace password_manager { | 27 namespace password_manager { |
| 27 | 28 |
| 28 class ContentPasswordManagerDriver; | 29 class ContentPasswordManagerDriver; |
| 29 | 30 |
| 30 // Creates and owns ContentPasswordManagerDrivers. There is one | 31 // Creates and owns ContentPasswordManagerDrivers. There is one |
| 31 // factory per WebContents, and one driver per render frame. | 32 // factory per WebContents, and one driver per render frame. |
| 32 class ContentPasswordManagerDriverFactory | 33 class ContentPasswordManagerDriverFactory |
| 33 : public content::WebContentsObserver, | 34 : public content::WebContentsObserver, |
| 34 public base::SupportsUserData::Data { | 35 public base::SupportsUserData::Data { |
| 35 public: | 36 public: |
| 36 static void CreateForWebContents(content::WebContents* web_contents, | 37 static void CreateForWebContents(content::WebContents* web_contents, |
| 37 PasswordManagerClient* client, | 38 PasswordManagerClient* client, |
| 38 autofill::AutofillClient* autofill_client); | 39 autofill::AutofillClient* autofill_client); |
| 39 ~ContentPasswordManagerDriverFactory() override; | 40 ~ContentPasswordManagerDriverFactory() override; |
| 40 | 41 |
| 41 static ContentPasswordManagerDriverFactory* FromWebContents( | 42 static ContentPasswordManagerDriverFactory* FromWebContents( |
| 42 content::WebContents* web_contents); | 43 content::WebContents* web_contents); |
| 43 | 44 |
| 44 static void BindPasswordManagerDriver( | 45 static void BindPasswordManagerDriver( |
| 45 content::RenderFrameHost* render_frame_host, | 46 content::RenderFrameHost* render_frame_host, |
| 47 const service_manager::BindSourceInfo& source_info, |
| 46 autofill::mojom::PasswordManagerDriverRequest request); | 48 autofill::mojom::PasswordManagerDriverRequest request); |
| 47 | 49 |
| 48 static void BindSensitiveInputVisibilityService( | 50 static void BindSensitiveInputVisibilityService( |
| 49 content::RenderFrameHost* render_frame_host, | 51 content::RenderFrameHost* render_frame_host, |
| 52 const service_manager::BindSourceInfo& source_info, |
| 50 blink::mojom::SensitiveInputVisibilityServiceRequest request); | 53 blink::mojom::SensitiveInputVisibilityServiceRequest request); |
| 51 | 54 |
| 52 ContentPasswordManagerDriver* GetDriverForFrame( | 55 ContentPasswordManagerDriver* GetDriverForFrame( |
| 53 content::RenderFrameHost* render_frame_host); | 56 content::RenderFrameHost* render_frame_host); |
| 54 | 57 |
| 55 // Requests all drivers to inform their renderers whether | 58 // Requests all drivers to inform their renderers whether |
| 56 // chrome://password-manager-internals is available. | 59 // chrome://password-manager-internals is available. |
| 57 void RequestSendLoggingAvailability(); | 60 void RequestSendLoggingAvailability(); |
| 58 | 61 |
| 59 // content::WebContentsObserver: | 62 // content::WebContentsObserver: |
| (...skipping 14 matching lines...) Expand all Loading... |
| 74 | 77 |
| 75 PasswordManagerClient* password_client_; | 78 PasswordManagerClient* password_client_; |
| 76 autofill::AutofillClient* autofill_client_; | 79 autofill::AutofillClient* autofill_client_; |
| 77 | 80 |
| 78 DISALLOW_COPY_AND_ASSIGN(ContentPasswordManagerDriverFactory); | 81 DISALLOW_COPY_AND_ASSIGN(ContentPasswordManagerDriverFactory); |
| 79 }; | 82 }; |
| 80 | 83 |
| 81 } // namespace password_manager | 84 } // namespace password_manager |
| 82 | 85 |
| 83 #endif // COMPONENTS_PASSWORD_MANAGER_CONTENT_BROWSER_CONTENT_PASSWORD_MANAGER_
DRIVER_FACTORY_H_ | 86 #endif // COMPONENTS_PASSWORD_MANAGER_CONTENT_BROWSER_CONTENT_PASSWORD_MANAGER_
DRIVER_FACTORY_H_ |
| OLD | NEW |