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 #include "components/password_manager/content/browser/content_password_manager_d
river_factory.h" | 5 #include "components/password_manager/content/browser/content_password_manager_d
river_factory.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 ContentPasswordManagerDriverFactory::FromWebContents( | 69 ContentPasswordManagerDriverFactory::FromWebContents( |
70 content::WebContents* contents) { | 70 content::WebContents* contents) { |
71 return static_cast<ContentPasswordManagerDriverFactory*>( | 71 return static_cast<ContentPasswordManagerDriverFactory*>( |
72 contents->GetUserData( | 72 contents->GetUserData( |
73 kContentPasswordManagerDriverFactoryWebContentsUserDataKey)); | 73 kContentPasswordManagerDriverFactoryWebContentsUserDataKey)); |
74 } | 74 } |
75 | 75 |
76 // static | 76 // static |
77 void ContentPasswordManagerDriverFactory::BindPasswordManagerDriver( | 77 void ContentPasswordManagerDriverFactory::BindPasswordManagerDriver( |
78 content::RenderFrameHost* render_frame_host, | 78 content::RenderFrameHost* render_frame_host, |
| 79 const service_manager::BindSourceInfo& source_info, |
79 autofill::mojom::PasswordManagerDriverRequest request) { | 80 autofill::mojom::PasswordManagerDriverRequest request) { |
80 content::WebContents* web_contents = | 81 content::WebContents* web_contents = |
81 content::WebContents::FromRenderFrameHost(render_frame_host); | 82 content::WebContents::FromRenderFrameHost(render_frame_host); |
82 if (!web_contents) | 83 if (!web_contents) |
83 return; | 84 return; |
84 | 85 |
85 ContentPasswordManagerDriverFactory* factory = | 86 ContentPasswordManagerDriverFactory* factory = |
86 ContentPasswordManagerDriverFactory::FromWebContents(web_contents); | 87 ContentPasswordManagerDriverFactory::FromWebContents(web_contents); |
87 // We try to bind to the driver, but if driver is not ready for now or totally | 88 // We try to bind to the driver, but if driver is not ready for now or totally |
88 // not available for this render frame host, the request will be just dropped. | 89 // not available for this render frame host, the request will be just dropped. |
89 // This would cause the message pipe to be closed, which will raise a | 90 // This would cause the message pipe to be closed, which will raise a |
90 // connection error on the peer side. | 91 // connection error on the peer side. |
91 if (!factory) | 92 if (!factory) |
92 return; | 93 return; |
93 | 94 |
94 ContentPasswordManagerDriver* driver = | 95 ContentPasswordManagerDriver* driver = |
95 factory->GetDriverForFrame(render_frame_host); | 96 factory->GetDriverForFrame(render_frame_host); |
96 if (driver) | 97 if (driver) |
97 driver->BindRequest(std::move(request)); | 98 driver->BindRequest(std::move(request)); |
98 } | 99 } |
99 | 100 |
100 // static | 101 // static |
101 void ContentPasswordManagerDriverFactory::BindSensitiveInputVisibilityService( | 102 void ContentPasswordManagerDriverFactory::BindSensitiveInputVisibilityService( |
102 content::RenderFrameHost* render_frame_host, | 103 content::RenderFrameHost* render_frame_host, |
| 104 const service_manager::BindSourceInfo& source_info, |
103 blink::mojom::SensitiveInputVisibilityServiceRequest request) { | 105 blink::mojom::SensitiveInputVisibilityServiceRequest request) { |
104 content::WebContents* web_contents = | 106 content::WebContents* web_contents = |
105 content::WebContents::FromRenderFrameHost(render_frame_host); | 107 content::WebContents::FromRenderFrameHost(render_frame_host); |
106 if (!web_contents) | 108 if (!web_contents) |
107 return; | 109 return; |
108 | 110 |
109 ContentPasswordManagerDriverFactory* factory = | 111 ContentPasswordManagerDriverFactory* factory = |
110 ContentPasswordManagerDriverFactory::FromWebContents(web_contents); | 112 ContentPasswordManagerDriverFactory::FromWebContents(web_contents); |
111 // We try to bind to the driver, but if driver is not ready for now or totally | 113 // We try to bind to the driver, but if driver is not ready for now or totally |
112 // not available for this render frame host, the request will be just dropped. | 114 // not available for this render frame host, the request will be just dropped. |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 ->second->DidNavigateFrame(navigation_handle); | 156 ->second->DidNavigateFrame(navigation_handle); |
155 } | 157 } |
156 | 158 |
157 void ContentPasswordManagerDriverFactory::RequestSendLoggingAvailability() { | 159 void ContentPasswordManagerDriverFactory::RequestSendLoggingAvailability() { |
158 for (const auto& key_val_iterator : frame_driver_map_) { | 160 for (const auto& key_val_iterator : frame_driver_map_) { |
159 key_val_iterator.second->SendLoggingAvailability(); | 161 key_val_iterator.second->SendLoggingAvailability(); |
160 } | 162 } |
161 } | 163 } |
162 | 164 |
163 } // namespace password_manager | 165 } // namespace password_manager |
OLD | NEW |