Chromium Code Reviews| 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 c5c50bf4136126177d73dbf711fad41cdcd6e35e..bcfb846cf5ea8ef24002618d935de9594c36bcbe 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" |
| @@ -277,6 +280,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, |
| + std::vector<GURL> federations) { |
|
vabr (Chromium)
2014/08/22 14:04:32
optional: My gut feeling would be that making this
|
| + // 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( |
| @@ -308,6 +351,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, |
| @@ -316,6 +360,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; |