Index: components/password_manager/content/renderer/credential_manager_client.h |
diff --git a/components/password_manager/content/renderer/credential_manager_client.h b/components/password_manager/content/renderer/credential_manager_client.h |
index 99bd96d412db8727a87b9267c3ecffd94c9a2dab..d87e4601f467ae873f2c066143331e87025cca39 100644 |
--- a/components/password_manager/content/renderer/credential_manager_client.h |
+++ b/components/password_manager/content/renderer/credential_manager_client.h |
@@ -6,9 +6,10 @@ |
#define COMPONENTS_PASSWORD_MANAGER_CONTENT_RENDERER_CREDENTIAL_MANAGER_CLIENT_H_ |
#include "base/compiler_specific.h" |
+#include "base/id_map.h" |
#include "base/macros.h" |
-#include "components/password_manager/content/public/interfaces/credential_manager.mojom.h" |
#include "content/public/renderer/render_view_observer.h" |
+#include "ipc/ipc_listener.h" |
#include "third_party/WebKit/public/platform/WebCredentialManagerClient.h" |
#include "third_party/WebKit/public/platform/WebCredentialManagerError.h" |
#include "third_party/WebKit/public/platform/WebVector.h" |
@@ -44,7 +45,19 @@ |
explicit CredentialManagerClient(content::RenderView* render_view); |
~CredentialManagerClient() override; |
- // blink::WebCredentialManagerClient: |
+ // RenderViewObserver: |
+ bool OnMessageReceived(const IPC::Message& message) override; |
+ |
+ // Message handlers for messages from the browser process: |
+ virtual void OnAcknowledgeStore(int request_id); |
+ virtual void OnAcknowledgeRequireUserMediation(int request_id); |
+ virtual void OnSendCredential(int request_id, |
+ const CredentialInfo& credential_info); |
+ virtual void OnRejectCredentialRequest( |
+ int request_id, |
+ blink::WebCredentialManagerError error); |
+ |
+ // blink::WebCredentialManager: |
void dispatchStore( |
const blink::WebCredential& credential, |
WebCredentialManagerClient::NotificationCallbacks* callbacks) override; |
@@ -55,9 +68,19 @@ |
RequestCallbacks* callbacks) override; |
private: |
- void ConnectToMojoCMIfNeeded(); |
+ typedef IDMap<blink::WebCredentialManagerClient::RequestCallbacks, |
+ IDMapOwnPointer> RequestCallbacksMap; |
+ typedef IDMap<blink::WebCredentialManagerClient::NotificationCallbacks, |
+ IDMapOwnPointer> NotificationCallbacksMap; |
- mojom::CredentialManagerPtr mojo_cm_service_; |
+ void RespondToNotificationCallback(int request_id, |
+ NotificationCallbacksMap* map); |
+ |
+ // Track the various blink::WebCredentialManagerClient::*Callbacks objects |
+ // generated from Blink. This class takes ownership of these objects. |
+ NotificationCallbacksMap store_callbacks_; |
+ NotificationCallbacksMap require_user_mediation_callbacks_; |
+ RequestCallbacksMap get_callbacks_; |
DISALLOW_COPY_AND_ASSIGN(CredentialManagerClient); |
}; |