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

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

Issue 1762603002: Switch components/password_manager code from IPC messages to Mojo. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Impl done, unit_tests and browser_tests not ready yet Created 4 years, 9 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 d87e4601f467ae873f2c066143331e87025cca39..d63c5fee7defe8e3af39d58ebd569d656ed82274 100644
--- a/components/password_manager/content/renderer/credential_manager_client.h
+++ b/components/password_manager/content/renderer/credential_manager_client.h
@@ -6,10 +6,9 @@
#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"
@@ -39,25 +38,19 @@ struct CredentialInfo;
//
// Note that each RenderView's WebView holds a pointer to the
// CredentialManagerClient (set in 'OnRenderViewCreated()') but does not own it.
+//
+// For now still inherit RenderViewObserver here just to keep liftcycle with
vabr (Chromium) 2016/03/09 16:26:30 nit: Frankly, nobody will periodically check on th
leonhsl(Using Gerrit) 2016/03/10 06:42:42 Done. Removed the comments. Actually I noticed tha
+// RenderView. Maybe later we can consider move
+// password_manager/content/renderer into Blink, to attach this instance's
+// lifecycle with blink::WebView and access mojo CrendentialManager
+// from Blink there?
class CredentialManagerClient : public blink::WebCredentialManagerClient,
public content::RenderViewObserver {
public:
explicit CredentialManagerClient(content::RenderView* render_view);
~CredentialManagerClient() override;
- // 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:
+ // blink::WebCredentialManagerClient:
void dispatchStore(
const blink::WebCredential& credential,
WebCredentialManagerClient::NotificationCallbacks* callbacks) override;
@@ -68,19 +61,9 @@ class CredentialManagerClient : public blink::WebCredentialManagerClient,
RequestCallbacks* callbacks) override;
private:
- typedef IDMap<blink::WebCredentialManagerClient::RequestCallbacks,
- IDMapOwnPointer> RequestCallbacksMap;
- typedef IDMap<blink::WebCredentialManagerClient::NotificationCallbacks,
- IDMapOwnPointer> NotificationCallbacksMap;
-
- void RespondToNotificationCallback(int request_id,
- NotificationCallbacksMap* map);
+ void ConnectToMojoCMIfNeeded();
- // 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_;
+ mojom::CredentialManagerPtr mojo_cm_service_;
DISALLOW_COPY_AND_ASSIGN(CredentialManagerClient);
};

Powered by Google App Engine
This is Rietveld 408576698