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
3 // found in the LICENSE file.
5 // Message definition file, included multiple times, hence no include guard.
10 #include "base/strings/string16.h"
11 #include "components/password_manager/core/common/credential_manager_types.h"
12 #include "content/public/common/common_param_traits.h"
13 #include "content/public/common/common_param_traits_macros.h"
14 #include "ipc/ipc_message_macros.h"
15 #include "ipc/ipc_message_utils.h"
16 #include "third_party/WebKit/public/platform/WebCredentialManagerError.h"
19 #define IPC_MESSAGE_START CredentialManagerMsgStart
21 IPC_ENUM_TRAITS_MAX_VALUE(
22 password_manager::CredentialType
,
23 password_manager::CredentialType::CREDENTIAL_TYPE_LAST
)
25 IPC_ENUM_TRAITS_MAX_VALUE(blink::WebCredentialManagerError::ErrorType
,
26 blink::WebCredentialManagerError::ErrorTypeLast
)
28 IPC_STRUCT_TRAITS_BEGIN(password_manager::CredentialInfo
)
29 IPC_STRUCT_TRAITS_MEMBER(type
)
30 IPC_STRUCT_TRAITS_MEMBER(id
)
31 IPC_STRUCT_TRAITS_MEMBER(name
)
32 IPC_STRUCT_TRAITS_MEMBER(icon
)
33 IPC_STRUCT_TRAITS_MEMBER(password
)
34 IPC_STRUCT_TRAITS_MEMBER(federation
)
35 IPC_STRUCT_TRAITS_END()
37 // ----------------------------------------------------------------------------
38 // Messages sent from the renderer to the browser
40 // Passes the notification from 'navigator.credentials.store()' up to
41 // the browser process in order to (among other things) prompt the user to save
42 // the credential she used for signin. The browser process will respond with a
43 // CredentialManagerMsg_AcknowledgeStore message.
44 IPC_MESSAGE_ROUTED2(CredentialManagerHostMsg_Store
,
46 password_manager::CredentialInfo
/* credential */)
48 // Passes the notification from 'navigator.credentials.requireUserMediation()'
49 // up to the browser process in order to clear the "zeroclick" bit on that
50 // origin's stored credentials. The browser process will respond with a
51 // CredentialManagerMsg_AcknowledgeRequireUserMediation message.
52 IPC_MESSAGE_ROUTED1(CredentialManagerHostMsg_RequireUserMediation
,
55 // Requests a credential from the browser process in response to a page calling
56 // 'navigator.credentials.get()'. The browser process will respond with a
57 // CredentialManagerMsg_SendCredential message.
58 IPC_MESSAGE_ROUTED3(CredentialManagerHostMsg_RequestCredential
,
60 bool /* zero_click_only */,
61 std::vector
<GURL
> /* federations */)
63 // ----------------------------------------------------------------------------
64 // Messages sent from the browser to the renderer
66 // Notify the renderer that the browser process has finished processing a
67 // CredentialManagerHostMsg_Store message.
68 IPC_MESSAGE_ROUTED1(CredentialManagerMsg_AcknowledgeStore
, int /* request_id */)
70 // Notify the renderer that the browser process has finished processing a
71 // CredentialManagerHostMsg_RequireUserMediation message.
72 IPC_MESSAGE_ROUTED1(CredentialManagerMsg_AcknowledgeRequireUserMediation
,
75 // Send a credential to the renderer in response to a
76 // CredentialManagerHostMsg_RequestCredential message.
77 IPC_MESSAGE_ROUTED2(CredentialManagerMsg_SendCredential
,
79 password_manager::CredentialInfo
/* credential */)
81 // Reject the credential request in response to a
82 // CredentialManagerHostMsg_RequestCredential message.
84 CredentialManagerMsg_RejectCredentialRequest
,
86 blink::WebCredentialManagerError::ErrorType
/* rejection_reason */)