| Index: chrome/browser/password_manager/chrome_password_manager_client.cc
|
| diff --git a/chrome/browser/password_manager/chrome_password_manager_client.cc b/chrome/browser/password_manager/chrome_password_manager_client.cc
|
| index 739726f704ce35a38ca5c7ada3e62d7305db6c3b..773641358394be4791ef87ea8bea7c51a11d1578 100644
|
| --- a/chrome/browser/password_manager/chrome_password_manager_client.cc
|
| +++ b/chrome/browser/password_manager/chrome_password_manager_client.cc
|
| @@ -8,6 +8,7 @@
|
| #include "base/command_line.h"
|
| #include "base/memory/singleton.h"
|
| #include "base/metrics/histogram.h"
|
| +#include "base/strings/string16.h"
|
| #include "base/strings/utf_string_conversions.h"
|
| #include "chrome/browser/password_manager/password_manager_util.h"
|
| #include "chrome/browser/password_manager/password_store_factory.h"
|
| @@ -25,6 +26,8 @@
|
| #include "components/autofill/core/browser/password_generator.h"
|
| #include "components/autofill/core/common/password_form.h"
|
| #include "components/password_manager/content/browser/password_manager_internals_service_factory.h"
|
| +#include "components/password_manager/content/common/credential_manager_messages.h"
|
| +#include "components/password_manager/content/common/credential_manager_types.h"
|
| #include "components/password_manager/core/browser/log_receiver.h"
|
| #include "components/password_manager/core/browser/password_form_manager.h"
|
| #include "components/password_manager/core/browser/password_manager.h"
|
| @@ -282,6 +285,46 @@ bool ChromePasswordManagerClient::IsLoggingActive() const {
|
| return can_use_log_router_ && !web_contents()->GetWebUI();
|
| }
|
|
|
| +void ChromePasswordManagerClient::OnNotifyFailedSignIn(
|
| + int request_id,
|
| + const password_manager::CredentialInfo&) {
|
| + // TODO(mkwst): This is a stub.
|
| + web_contents()->GetRenderViewHost()->Send(
|
| + new CredentialManagerMsg_AcknowledgeFailedSignIn(
|
| + web_contents()->GetRenderViewHost()->GetRoutingID(), request_id));
|
| +}
|
| +
|
| +void ChromePasswordManagerClient::OnNotifySignedIn(
|
| + int request_id,
|
| + const password_manager::CredentialInfo&) {
|
| + // TODO(mkwst): This is a stub.
|
| + web_contents()->GetRenderViewHost()->Send(
|
| + new CredentialManagerMsg_AcknowledgeSignedIn(
|
| + web_contents()->GetRenderViewHost()->GetRoutingID(), request_id));
|
| +}
|
| +
|
| +void ChromePasswordManagerClient::OnNotifySignedOut(int request_id) {
|
| + // TODO(mkwst): This is a stub.
|
| + web_contents()->GetRenderViewHost()->Send(
|
| + new CredentialManagerMsg_AcknowledgeSignedOut(
|
| + web_contents()->GetRenderViewHost()->GetRoutingID(), request_id));
|
| +}
|
| +
|
| +void ChromePasswordManagerClient::OnRequestCredential(
|
| + int request_id,
|
| + bool zero_click_only,
|
| + const std::vector<GURL>& federations) {
|
| + // TODO(mkwst): This is a stub.
|
| + password_manager::CredentialInfo info(base::ASCIIToUTF16("id"),
|
| + base::ASCIIToUTF16("name"),
|
| + GURL("https://example.com/image.png"));
|
| + web_contents()->GetRenderViewHost()->Send(
|
| + new CredentialManagerMsg_SendCredential(
|
| + web_contents()->GetRenderViewHost()->GetRoutingID(),
|
| + request_id,
|
| + info));
|
| +}
|
| +
|
| // static
|
| password_manager::PasswordGenerationManager*
|
| ChromePasswordManagerClient::GetGenerationManagerFromWebContents(
|
| @@ -313,6 +356,7 @@ bool ChromePasswordManagerClient::OnMessageReceived(
|
| const IPC::Message& message) {
|
| bool handled = true;
|
| IPC_BEGIN_MESSAGE_MAP(ChromePasswordManagerClient, message)
|
| + // Autofill messages:
|
| IPC_MESSAGE_HANDLER(AutofillHostMsg_ShowPasswordGenerationPopup,
|
| ShowPasswordGenerationPopup)
|
| IPC_MESSAGE_HANDLER(AutofillHostMsg_ShowPasswordEditingPopup,
|
| @@ -321,6 +365,18 @@ bool ChromePasswordManagerClient::OnMessageReceived(
|
| HidePasswordGenerationPopup)
|
| IPC_MESSAGE_HANDLER(AutofillHostMsg_PasswordAutofillAgentConstructed,
|
| NotifyRendererOfLoggingAvailability)
|
| +
|
| + // Credential Manager messages:
|
| + IPC_MESSAGE_HANDLER(CredentialManagerHostMsg_NotifyFailedSignIn,
|
| + OnNotifyFailedSignIn);
|
| + IPC_MESSAGE_HANDLER(CredentialManagerHostMsg_NotifySignedIn,
|
| + OnNotifySignedIn);
|
| + IPC_MESSAGE_HANDLER(CredentialManagerHostMsg_NotifySignedOut,
|
| + OnNotifySignedOut);
|
| + IPC_MESSAGE_HANDLER(CredentialManagerHostMsg_RequestCredential,
|
| + OnRequestCredential);
|
| +
|
| + // Default:
|
| IPC_MESSAGE_UNHANDLED(handled = false)
|
| IPC_END_MESSAGE_MAP()
|
| return handled;
|
|
|