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 // Chrome-specific IPC messages for extensions.
6 // Extension-related messages that aren't specific to Chrome live in
7 // extensions/common/extension_messages.h.
9 // Multiply-included message file, hence no include guard.
13 #include "base/strings/string16.h"
14 #include "chrome/common/extensions/api/webstore/webstore_api_constants.h"
15 #include "chrome/common/extensions/webstore_install_result.h"
16 #include "chrome/common/web_application_info.h"
17 #include "extensions/common/stack_frame.h"
18 #include "ipc/ipc_message_macros.h"
21 #define IPC_MESSAGE_START ChromeExtensionMsgStart
23 IPC_ENUM_TRAITS_MAX_VALUE(extensions::api::webstore::InstallStage,
24 extensions::api::webstore::INSTALL_STAGE_INSTALLING)
25 IPC_ENUM_TRAITS_MAX_VALUE(extensions::webstore_install::Result,
26 extensions::webstore_install::RESULT_LAST)
28 IPC_STRUCT_TRAITS_BEGIN(extensions::StackFrame)
29 IPC_STRUCT_TRAITS_MEMBER(line_number)
30 IPC_STRUCT_TRAITS_MEMBER(column_number)
31 IPC_STRUCT_TRAITS_MEMBER(source)
32 IPC_STRUCT_TRAITS_MEMBER(function)
33 IPC_STRUCT_TRAITS_END()
35 IPC_STRUCT_TRAITS_BEGIN(WebApplicationInfo::IconInfo)
36 IPC_STRUCT_TRAITS_MEMBER(url)
37 IPC_STRUCT_TRAITS_MEMBER(width)
38 IPC_STRUCT_TRAITS_MEMBER(height)
39 IPC_STRUCT_TRAITS_MEMBER(data)
40 IPC_STRUCT_TRAITS_END()
42 IPC_STRUCT_TRAITS_BEGIN(WebApplicationInfo)
43 IPC_STRUCT_TRAITS_MEMBER(title)
44 IPC_STRUCT_TRAITS_MEMBER(description)
45 IPC_STRUCT_TRAITS_MEMBER(app_url)
46 IPC_STRUCT_TRAITS_MEMBER(icons)
47 IPC_STRUCT_TRAITS_END()
49 // Messages sent from the browser to the renderer.
51 // Requests application info for the page. The renderer responds back with
52 // ExtensionHostMsg_DidGetApplicationInfo.
53 IPC_MESSAGE_ROUTED0(ChromeExtensionMsg_GetApplicationInfo)
55 // Set the top-level frame to the provided name.
56 IPC_MESSAGE_ROUTED1(ChromeViewMsg_SetName,
57 std::string /* frame_name */)
59 // Toggles visual muting of the render view area. This is on when a constrained
61 IPC_MESSAGE_ROUTED1(ChromeViewMsg_SetVisuallyDeemphasized,
62 bool /* deemphazied */)
64 // Sent to the renderer if install stage updates were requested for an inline
66 IPC_MESSAGE_ROUTED1(ExtensionMsg_InlineInstallStageChanged,
67 extensions::api::webstore::InstallStage /* stage */)
69 // Sent to the renderer if download progress updates were requested for an
71 IPC_MESSAGE_ROUTED1(ExtensionMsg_InlineInstallDownloadProgress,
72 int /* percent_downloaded */)
74 // Send to renderer once the installation mentioned on
75 // ExtensionHostMsg_InlineWebstoreInstall is complete.
76 IPC_MESSAGE_ROUTED4(ExtensionMsg_InlineWebstoreInstallResponse,
77 int32 /* install id */,
78 bool /* whether the install was successful */,
79 std::string /* error */,
80 extensions::webstore_install::Result /* result */)
82 // Messages sent from the renderer to the browser.
84 // Informs the browser of updated frame names.
85 IPC_MESSAGE_ROUTED2(ChromeViewHostMsg_UpdateFrameName,
86 bool /* is_top_level */,
87 std::string /* name */)
89 // Sent by the renderer to check if a URL has permission to trigger a clipboard
90 // read/write operation from the DOM.
91 IPC_SYNC_MESSAGE_CONTROL1_1(ChromeViewHostMsg_CanTriggerClipboardRead,
94 IPC_SYNC_MESSAGE_CONTROL1_1(ChromeViewHostMsg_CanTriggerClipboardWrite,
98 // Tells listeners that a detailed message was reported to the console by
100 IPC_MESSAGE_ROUTED4(ChromeViewHostMsg_DetailedConsoleMessageAdded,
101 base::string16 /* message */,
102 base::string16 /* source */,
103 extensions::StackTrace /* stack trace */,
104 int32 /* severity level */)
106 // Sent by the renderer to implement chrome.webstore.install().
107 IPC_MESSAGE_ROUTED5(ExtensionHostMsg_InlineWebstoreInstall,
108 int32 /* install id */,
109 int32 /* return route id */,
110 std::string /* Web Store item ID */,
111 GURL /* requestor URL */,
112 int /* listeners_mask */)
114 IPC_MESSAGE_ROUTED1(ChromeExtensionHostMsg_DidGetApplicationInfo,