OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef COMPONENTS_PASSWORD_MANAGER_CONTENT_RENDERER_CREDENTIAL_MANAGER_CLIENT_H
_ | 5 #ifndef COMPONENTS_PASSWORD_MANAGER_CONTENT_RENDERER_CREDENTIAL_MANAGER_CLIENT_H
_ |
6 #define COMPONENTS_PASSWORD_MANAGER_CONTENT_RENDERER_CREDENTIAL_MANAGER_CLIENT_H
_ | 6 #define COMPONENTS_PASSWORD_MANAGER_CONTENT_RENDERER_CREDENTIAL_MANAGER_CLIENT_H
_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/id_map.h" | 10 #include "base/id_map.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 public: | 49 public: |
50 explicit CredentialManagerClient(content::RenderView* render_view); | 50 explicit CredentialManagerClient(content::RenderView* render_view); |
51 ~CredentialManagerClient() override; | 51 ~CredentialManagerClient() override; |
52 | 52 |
53 // RenderViewObserver: | 53 // RenderViewObserver: |
54 bool OnMessageReceived(const IPC::Message& message) override; | 54 bool OnMessageReceived(const IPC::Message& message) override; |
55 | 55 |
56 // Message handlers for messages from the browser process: | 56 // Message handlers for messages from the browser process: |
57 virtual void OnAcknowledgeFailedSignIn(int request_id); | 57 virtual void OnAcknowledgeFailedSignIn(int request_id); |
58 virtual void OnAcknowledgeSignedIn(int request_id); | 58 virtual void OnAcknowledgeSignedIn(int request_id); |
59 virtual void OnAcknowledgeSignedOut(int request_id); | 59 virtual void OnAcknowledgeRequireUserMediation(int request_id); |
60 virtual void OnSendCredential(int request_id, | 60 virtual void OnSendCredential(int request_id, |
61 const CredentialInfo& credential_info); | 61 const CredentialInfo& credential_info); |
62 virtual void OnRejectCredentialRequest( | 62 virtual void OnRejectCredentialRequest( |
63 int request_id, | 63 int request_id, |
64 blink::WebCredentialManagerError::ErrorType error_type); | 64 blink::WebCredentialManagerError::ErrorType error_type); |
65 | 65 |
66 // blink::WebCredentialManager: | 66 // blink::WebCredentialManager: |
67 virtual void dispatchFailedSignIn( | 67 virtual void dispatchFailedSignIn( |
68 const blink::WebCredential& credential, | 68 const blink::WebCredential& credential, |
69 WebCredentialManagerClient::NotificationCallbacks* callbacks); | 69 WebCredentialManagerClient::NotificationCallbacks* callbacks); |
70 virtual void dispatchSignedIn( | 70 virtual void dispatchSignedIn( |
71 const blink::WebCredential& credential, | 71 const blink::WebCredential& credential, |
72 WebCredentialManagerClient::NotificationCallbacks* callbacks); | 72 WebCredentialManagerClient::NotificationCallbacks* callbacks); |
73 virtual void dispatchSignedOut(NotificationCallbacks* callbacks); | 73 virtual void dispatchRequireUserMediation(NotificationCallbacks* callbacks); |
74 virtual void dispatchRequest( | 74 virtual void dispatchRequest( |
75 bool zero_click_only, | 75 bool zero_click_only, |
76 const blink::WebVector<blink::WebURL>& federations, | 76 const blink::WebVector<blink::WebURL>& federations, |
77 RequestCallbacks* callbacks); | 77 RequestCallbacks* callbacks); |
78 | 78 |
79 private: | 79 private: |
80 typedef IDMap<blink::WebCredentialManagerClient::RequestCallbacks, | 80 typedef IDMap<blink::WebCredentialManagerClient::RequestCallbacks, |
81 IDMapOwnPointer> RequestCallbacksMap; | 81 IDMapOwnPointer> RequestCallbacksMap; |
82 typedef IDMap<blink::WebCredentialManagerClient::NotificationCallbacks, | 82 typedef IDMap<blink::WebCredentialManagerClient::NotificationCallbacks, |
83 IDMapOwnPointer> NotificationCallbacksMap; | 83 IDMapOwnPointer> NotificationCallbacksMap; |
84 | 84 |
85 void RespondToNotificationCallback(int request_id, | 85 void RespondToNotificationCallback(int request_id, |
86 NotificationCallbacksMap* map); | 86 NotificationCallbacksMap* map); |
87 | 87 |
88 // Track the various blink::WebCredentialManagerClient::*Callbacks objects | 88 // Track the various blink::WebCredentialManagerClient::*Callbacks objects |
89 // generated from Blink. This class takes ownership of these objects. | 89 // generated from Blink. This class takes ownership of these objects. |
90 NotificationCallbacksMap failed_sign_in_callbacks_; | 90 NotificationCallbacksMap failed_sign_in_callbacks_; |
91 NotificationCallbacksMap signed_in_callbacks_; | 91 NotificationCallbacksMap signed_in_callbacks_; |
92 NotificationCallbacksMap signed_out_callbacks_; | 92 NotificationCallbacksMap require_user_mediation_callbacks_; |
93 RequestCallbacksMap request_callbacks_; | 93 RequestCallbacksMap request_callbacks_; |
94 | 94 |
95 DISALLOW_COPY_AND_ASSIGN(CredentialManagerClient); | 95 DISALLOW_COPY_AND_ASSIGN(CredentialManagerClient); |
96 }; | 96 }; |
97 | 97 |
98 } // namespace password_manager | 98 } // namespace password_manager |
99 | 99 |
100 #endif // COMPONENTS_PASSWORD_MANAGER_CONTENT_RENDERER_CREDENTIAL_MANAGER_CLIEN
T_H_ | 100 #endif // COMPONENTS_PASSWORD_MANAGER_CONTENT_RENDERER_CREDENTIAL_MANAGER_CLIEN
T_H_ |
OLD | NEW |