diff options
author | msramek <msramek@chromium.org> | 2015-07-02 05:41:47 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-07-02 12:42:29 +0000 |
commit | 94c6e97308ce39079a3f5213db4acefbf6eaac9b (patch) | |
tree | 1a41fe4580210d1c484db80946704018d42b9728 | |
parent | 090ba6485a6beca6a6f612a8219fbf66ae04aae4 (diff) | |
download | chromium_src-94c6e97308ce39079a3f5213db4acefbf6eaac9b.zip chromium_src-94c6e97308ce39079a3f5213db4acefbf6eaac9b.tar.gz chromium_src-94c6e97308ce39079a3f5213db4acefbf6eaac9b.tar.bz2 |
Remove the notifyFailedSignedIn callback from Chromium.
As this is not a part of the specification https://w3c.github.io/webappsec/specs/credentialmanagement/#credentialcontainer
Also remove the associated acknowledgeFailedSignIn messages.
This patch is a part of a two-sided patchset:
Blink: https://codereview.chromium.org/1217463002/
Chromium: https://codereview.chromium.org/1215653003/ <-- this patch
BUG=494880
Review URL: https://codereview.chromium.org/1215653003
Cr-Commit-Position: refs/heads/master@{#337208}
9 files changed, 0 insertions, 94 deletions
diff --git a/components/password_manager/content/browser/credential_manager_dispatcher.cc b/components/password_manager/content/browser/credential_manager_dispatcher.cc index 01e182e..ab48d62 100644 --- a/components/password_manager/content/browser/credential_manager_dispatcher.cc +++ b/components/password_manager/content/browser/credential_manager_dispatcher.cc @@ -40,8 +40,6 @@ bool CredentialManagerDispatcher::OnMessageReceived( const IPC::Message& message) { bool handled = true; IPC_BEGIN_MESSAGE_MAP(CredentialManagerDispatcher, message) - IPC_MESSAGE_HANDLER(CredentialManagerHostMsg_NotifyFailedSignIn, - OnNotifyFailedSignIn); IPC_MESSAGE_HANDLER(CredentialManagerHostMsg_NotifySignedIn, OnNotifySignedIn); IPC_MESSAGE_HANDLER(CredentialManagerHostMsg_RequireUserMediation, @@ -53,15 +51,6 @@ bool CredentialManagerDispatcher::OnMessageReceived( return handled; } -void CredentialManagerDispatcher::OnNotifyFailedSignIn(int request_id, - const CredentialInfo&) { - DCHECK(request_id); - // TODO(mkwst): This is a stub. - web_contents()->GetRenderViewHost()->Send( - new CredentialManagerMsg_AcknowledgeFailedSignIn( - web_contents()->GetRenderViewHost()->GetRoutingID(), request_id)); -} - void CredentialManagerDispatcher::OnNotifySignedIn( int request_id, const password_manager::CredentialInfo& credential) { diff --git a/components/password_manager/content/browser/credential_manager_dispatcher.h b/components/password_manager/content/browser/credential_manager_dispatcher.h index 1ab038d..705d3cb 100644 --- a/components/password_manager/content/browser/credential_manager_dispatcher.h +++ b/components/password_manager/content/browser/credential_manager_dispatcher.h @@ -44,11 +44,6 @@ class CredentialManagerDispatcher ~CredentialManagerDispatcher() override; // Called in response to an IPC from the renderer, triggered by a page's call - // to 'navigator.credentials.notifyFailedSignIn'. - virtual void OnNotifyFailedSignIn(int request_id, - const password_manager::CredentialInfo&); - - // Called in response to an IPC from the renderer, triggered by a page's call // to 'navigator.credentials.notifySignedIn'. virtual void OnNotifySignedIn(int request_id, const password_manager::CredentialInfo&); diff --git a/components/password_manager/content/browser/credential_manager_dispatcher_unittest.cc b/components/password_manager/content/browser/credential_manager_dispatcher_unittest.cc index ec69d28..d1c26f0 100644 --- a/components/password_manager/content/browser/credential_manager_dispatcher_unittest.cc +++ b/components/password_manager/content/browser/credential_manager_dispatcher_unittest.cc @@ -214,18 +214,6 @@ class CredentialManagerDispatcherTest scoped_ptr<CredentialManagerDispatcher> dispatcher_; }; -TEST_F(CredentialManagerDispatcherTest, CredentialManagerOnNotifyFailedSignIn) { - CredentialInfo info; - info.type = CredentialType::CREDENTIAL_TYPE_PASSWORD; - dispatcher()->OnNotifyFailedSignIn(kRequestId, info); - - const uint32 kMsgID = CredentialManagerMsg_AcknowledgeFailedSignIn::ID; - const IPC::Message* message = - process()->sink().GetFirstMessageMatching(kMsgID); - EXPECT_TRUE(message); - process()->sink().ClearMessages(); -} - TEST_F(CredentialManagerDispatcherTest, CredentialManagerOnNotifySignedIn) { CredentialInfo info( form_, password_manager::CredentialType::CREDENTIAL_TYPE_PASSWORD); diff --git a/components/password_manager/content/common/credential_manager_messages.h b/components/password_manager/content/common/credential_manager_messages.h index bf228d0..d9cf30e 100644 --- a/components/password_manager/content/common/credential_manager_messages.h +++ b/components/password_manager/content/common/credential_manager_messages.h @@ -37,15 +37,6 @@ IPC_STRUCT_TRAITS_END() // ---------------------------------------------------------------------------- // Messages sent from the renderer to the browser -// Passes the notification from 'navigator.credentials.notifyFailedSignIn()' up -// to the browser process in order to suppress the automatic bubble which would -// pop up in order to prompt the user to save the credential she used for -// signin. The browser process will respond with a -// CredentialManagerMsg_AcknowledgeFailedSignedIn message. -IPC_MESSAGE_ROUTED2(CredentialManagerHostMsg_NotifyFailedSignIn, - int /* request_id */, - password_manager::CredentialInfo /* credential */) - // Passes the notification from 'navigator.credentials.notifySignedIn()' up to // the browser process in order to (among other things) prompt the user to save // the credential she used for signin. The browser process will respond with a @@ -73,11 +64,6 @@ IPC_MESSAGE_ROUTED3(CredentialManagerHostMsg_RequestCredential, // Messages sent from the browser to the renderer // Notify the renderer that the browser process has finished processing a -// CredentialManagerHostMsg_NotifyFailedSignedIn message. -IPC_MESSAGE_ROUTED1(CredentialManagerMsg_AcknowledgeFailedSignIn, - int /* request_id */) - -// Notify the renderer that the browser process has finished processing a // CredentialManagerHostMsg_NotifySignedIn message. IPC_MESSAGE_ROUTED1(CredentialManagerMsg_AcknowledgeSignedIn, int /* request_id */) diff --git a/components/password_manager/content/renderer/credential_manager_client.cc b/components/password_manager/content/renderer/credential_manager_client.cc index 5b37569..3d575b0 100644 --- a/components/password_manager/content/renderer/credential_manager_client.cc +++ b/components/password_manager/content/renderer/credential_manager_client.cc @@ -51,8 +51,6 @@ CredentialManagerClient::~CredentialManagerClient() { bool CredentialManagerClient::OnMessageReceived(const IPC::Message& message) { bool handled = true; IPC_BEGIN_MESSAGE_MAP(CredentialManagerClient, message) - IPC_MESSAGE_HANDLER(CredentialManagerMsg_AcknowledgeFailedSignIn, - OnAcknowledgeFailedSignIn) IPC_MESSAGE_HANDLER(CredentialManagerMsg_AcknowledgeSignedIn, OnAcknowledgeSignedIn) IPC_MESSAGE_HANDLER(CredentialManagerMsg_AcknowledgeRequireUserMediation, @@ -65,10 +63,6 @@ bool CredentialManagerClient::OnMessageReceived(const IPC::Message& message) { return handled; } -void CredentialManagerClient::OnAcknowledgeFailedSignIn(int request_id) { - RespondToNotificationCallback(request_id, &failed_sign_in_callbacks_); -} - void CredentialManagerClient::OnAcknowledgeSignedIn(int request_id) { RespondToNotificationCallback(request_id, &signed_in_callbacks_); } @@ -114,15 +108,6 @@ void CredentialManagerClient::OnRejectCredentialRequest( // ----------------------------------------------------------------------------- // Dispatch messages from the renderer to the browser. -void CredentialManagerClient::dispatchFailedSignIn( - const blink::WebCredential& credential, - blink::WebCredentialManagerClient::NotificationCallbacks* callbacks) { - int request_id = failed_sign_in_callbacks_.Add(callbacks); - CredentialInfo info(WebCredentialToCredentialInfo(credential)); - Send(new CredentialManagerHostMsg_NotifyFailedSignIn( - routing_id(), request_id, info)); -} - void CredentialManagerClient::dispatchSignedIn( const blink::WebCredential& credential, blink::WebCredentialManagerClient::NotificationCallbacks* callbacks) { diff --git a/components/password_manager/content/renderer/credential_manager_client.h b/components/password_manager/content/renderer/credential_manager_client.h index c854636..8cd5119 100644 --- a/components/password_manager/content/renderer/credential_manager_client.h +++ b/components/password_manager/content/renderer/credential_manager_client.h @@ -54,7 +54,6 @@ class CredentialManagerClient : public blink::WebCredentialManagerClient, bool OnMessageReceived(const IPC::Message& message) override; // Message handlers for messages from the browser process: - virtual void OnAcknowledgeFailedSignIn(int request_id); virtual void OnAcknowledgeSignedIn(int request_id); virtual void OnAcknowledgeRequireUserMediation(int request_id); virtual void OnSendCredential(int request_id, @@ -64,9 +63,6 @@ class CredentialManagerClient : public blink::WebCredentialManagerClient, blink::WebCredentialManagerError::ErrorType error_type); // blink::WebCredentialManager: - virtual void dispatchFailedSignIn( - const blink::WebCredential& credential, - WebCredentialManagerClient::NotificationCallbacks* callbacks); virtual void dispatchSignedIn( const blink::WebCredential& credential, WebCredentialManagerClient::NotificationCallbacks* callbacks); diff --git a/components/password_manager/content/renderer/credential_manager_client_browsertest.cc b/components/password_manager/content/renderer/credential_manager_client_browsertest.cc index 5095fd8..2207167 100644 --- a/components/password_manager/content/renderer/credential_manager_client_browsertest.cc +++ b/components/password_manager/content/renderer/credential_manager_client_browsertest.cc @@ -52,13 +52,6 @@ class CredentialManagerClientTest : public content::RenderViewTest { return false; switch (message_id) { - case CredentialManagerHostMsg_NotifyFailedSignIn::ID: { - base::Tuple<int, CredentialInfo> param; - CredentialManagerHostMsg_NotifyFailedSignIn::Read(message, ¶m); - request_id = base::get<0>(param); - break; - } - case CredentialManagerHostMsg_NotifySignedIn::ID: { base::Tuple<int, CredentialInfo> param; CredentialManagerHostMsg_NotifySignedIn::Read(message, ¶m); @@ -146,23 +139,6 @@ class TestRequestCallbacks } // namespace -TEST_F(CredentialManagerClientTest, SendNotifyFailedSignIn) { - int request_id; - EXPECT_FALSE(ExtractRequestId(CredentialManagerHostMsg_NotifyFailedSignIn::ID, - request_id)); - - scoped_ptr<TestNotificationCallbacks> callbacks( - new TestNotificationCallbacks(this)); - client_->dispatchFailedSignIn(*credential(), callbacks.release()); - - EXPECT_TRUE(ExtractRequestId(CredentialManagerHostMsg_NotifyFailedSignIn::ID, - request_id)); - - client_->OnAcknowledgeFailedSignIn(request_id); - EXPECT_TRUE(callback_succeeded()); - EXPECT_FALSE(callback_errored()); -} - TEST_F(CredentialManagerClientTest, SendNotifySignedIn) { int request_id; EXPECT_FALSE(ExtractRequestId(CredentialManagerHostMsg_NotifySignedIn::ID, diff --git a/components/test_runner/mock_credential_manager_client.cc b/components/test_runner/mock_credential_manager_client.cc index 6071578..bed2653 100644 --- a/components/test_runner/mock_credential_manager_client.cc +++ b/components/test_runner/mock_credential_manager_client.cc @@ -19,13 +19,6 @@ void MockCredentialManagerClient::SetResponse( credential_.reset(credential); } -void MockCredentialManagerClient::dispatchFailedSignIn( - const blink::WebCredential&, - blink::WebCredentialManagerClient::NotificationCallbacks* callbacks) { - callbacks->onSuccess(); - delete callbacks; -} - void MockCredentialManagerClient::dispatchSignedIn( const blink::WebCredential&, blink::WebCredentialManagerClient::NotificationCallbacks* callbacks) { diff --git a/components/test_runner/mock_credential_manager_client.h b/components/test_runner/mock_credential_manager_client.h index f86f89b..03a2509 100644 --- a/components/test_runner/mock_credential_manager_client.h +++ b/components/test_runner/mock_credential_manager_client.h @@ -26,8 +26,6 @@ class MockCredentialManagerClient : public blink::WebCredentialManagerClient { void SetResponse(blink::WebCredential* credential); // blink::WebCredentialManager: - virtual void dispatchFailedSignIn(const blink::WebCredential& credential, - NotificationCallbacks* callbacks); virtual void dispatchSignedIn(const blink::WebCredential& credential, NotificationCallbacks* callbacks); virtual void dispatchRequireUserMediation(NotificationCallbacks* callbacks); |