| 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 "chrome/browser/password_manager/chrome_password_manager_client.h" | 5 #include "chrome/browser/password_manager/chrome_password_manager_client.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 629 // static | 629 // static |
| 630 void ChromePasswordManagerClient::BindCredentialManager( | 630 void ChromePasswordManagerClient::BindCredentialManager( |
| 631 content::RenderFrameHost* render_frame_host, | 631 content::RenderFrameHost* render_frame_host, |
| 632 password_manager::mojom::CredentialManagerRequest request) { | 632 password_manager::mojom::CredentialManagerRequest request) { |
| 633 content::WebContents* web_contents = | 633 content::WebContents* web_contents = |
| 634 content::WebContents::FromRenderFrameHost(render_frame_host); | 634 content::WebContents::FromRenderFrameHost(render_frame_host); |
| 635 DCHECK(web_contents); | 635 DCHECK(web_contents); |
| 636 | 636 |
| 637 ChromePasswordManagerClient* instance = | 637 ChromePasswordManagerClient* instance = |
| 638 ChromePasswordManagerClient::FromWebContents(web_contents); | 638 ChromePasswordManagerClient::FromWebContents(web_contents); |
| 639 DCHECK(instance); | 639 |
| 640 // Try to bind to the driver, but if driver is not available for this render |
| 641 // frame host, the request will be just dropped. This will cause the message |
| 642 // pipe to be closed, which will raise a connection error on the peer side. |
| 643 if (!instance) |
| 644 return; |
| 645 |
| 640 instance->credential_manager_impl_.BindRequest(std::move(request)); | 646 instance->credential_manager_impl_.BindRequest(std::move(request)); |
| 641 } | 647 } |
| OLD | NEW |