Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(450)

Unified Diff: components/password_manager/content/renderer/credential_manager_client.h

Issue 1861973002: Revert of Switch components/password_manager code from IPC messages to Mojo. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
};

Powered by Google App Engine
This is Rietveld 408576698