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