Chromium Code Reviews| Index: components/password_manager/content/renderer/credential_manager_dispatcher.h |
| diff --git a/components/password_manager/content/renderer/credential_manager_dispatcher.h b/components/password_manager/content/renderer/credential_manager_dispatcher.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..2d80622012f3cd0ded52082e78caa3e34310b4cb |
| --- /dev/null |
| +++ b/components/password_manager/content/renderer/credential_manager_dispatcher.h |
| @@ -0,0 +1,60 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef COMPONENTS_PASSWORD_MANAGER_CONTENT_RENDERER_CREDENTIAL_MANAGER_DISPATCHER_H_ |
| +#define COMPONENTS_PASSWORD_MANAGER_CONTENT_RENDERER_CREDENTIAL_MANAGER_DISPATCHER_H_ |
| + |
| +#include "base/basictypes.h" |
| +#include "base/compiler_specific.h" |
| +#include "base/id_map.h" |
| +#include "ipc/ipc_listener.h" |
| +#include "third_party/WebKit/public/platform/WebCredential.h" |
| +#include "third_party/WebKit/public/platform/WebCredentialManager.h" |
| +#include "third_party/WebKit/public/platform/WebString.h" |
| +#include "third_party/WebKit/public/platform/WebURL.h" |
| +#include "third_party/WebKit/public/platform/WebVector.h" |
| + |
| +namespace password_manager { |
| + |
| +struct CredentialManagerCredentialInfo; |
| + |
| +class CredentialManagerDispatcher : public blink::WebCredentialManager, |
| + public IPC::Listener { |
| + public: |
| + CredentialManagerDispatcher(); |
| + virtual ~CredentialManagerDispatcher(); |
| + |
| + // IPC::Listener: |
| + virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
| + |
| + // Message handlers for messages from the browser process: |
| + void OnFailedSignInResponse(int request_id); |
| + void OnSignedInResponse(int request_id); |
| + void OnSignedOutResponse(int request_id); |
| + void OnRequestResponse(int request_id, const CredentialManagerCredentialInfo&); |
| + |
| + // blink::WebCredentialManager: |
| + virtual void dispatchFailedSignIn(const blink::WebCredential&, NotificationCallbacks*) OVERRIDE; |
|
Ilya Sherman
2014/08/15 20:42:38
Hmm, what's a NotificationCallbacks?
Mike West
2014/08/19 08:37:15
Changed this to blink::WebCredentialManager::Notif
|
| + virtual void dispatchSignedIn(const blink::WebCredential&, NotificationCallbacks*) OVERRIDE; |
| + virtual void dispatchSignedOut(NotificationCallbacks*) OVERRIDE; |
| + virtual void dispatchRequest(bool zeroClickOnly, const blink::WebVector<blink::WebURL>& federations, RequestCallbacks*) OVERRIDE; |
| + |
| + private: |
| + typedef IDMap<RequestCallbacks, IDMapOwnPointer> RequestCallbacksMap; |
| + typedef IDMap<NotificationCallbacks, IDMapOwnPointer> NotificationCallbacksMap; |
| + |
| + NotificationCallbacksMap failed_sign_in_callbacks_; |
| + NotificationCallbacksMap signed_in_callbacks_; |
| + NotificationCallbacksMap signed_out_callbacks_; |
| + RequestCallbacksMap request_callbacks_; |
| + |
| + int routing_id_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(CredentialManagerDispatcher); |
| +}; |
| + |
| +} // namespace password_manager |
| + |
| +#endif // COMPONENTS_PASSWORD_MANAGER_CONTENT_RENDERER_CREDENTIAL_MANAGER_DISPATCHER_H_ |
| + |