diff options
author | brettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-26 23:19:03 +0000 |
---|---|---|
committer | brettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-26 23:19:03 +0000 |
commit | 1136a60c7d8e06859369f906e2581648e93e967e (patch) | |
tree | 6a029b3d4fc3b5ad095ba3d74d4c610fd3603d48 /chrome/common | |
parent | fc331b1dce8781192f8c89cfc8629b6c5b82c47a (diff) | |
download | chromium_src-1136a60c7d8e06859369f906e2581648e93e967e.zip chromium_src-1136a60c7d8e06859369f906e2581648e93e967e.tar.gz chromium_src-1136a60c7d8e06859369f906e2581648e93e967e.tar.bz2 |
Make render_view_host compile on Mac & Linux, add to the build.
Review URL: http://codereview.chromium.org/18600
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8672 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common')
-rw-r--r-- | chrome/common/render_messages.h | 31 | ||||
-rw-r--r-- | chrome/common/render_messages_internal.h | 26 |
2 files changed, 42 insertions, 15 deletions
diff --git a/chrome/common/render_messages.h b/chrome/common/render_messages.h index b0338b7..e279270ec 100644 --- a/chrome/common/render_messages.h +++ b/chrome/common/render_messages.h @@ -445,6 +445,18 @@ enum ViewHostMsg_ImeControl { IME_COMPLETE_COMPOSITION, }; +// This structure is passed around where we need a modal dialog event, which +// is currently not plumbed on Mac & Linux. +// +// TODO(port) Fix this. This structure should probably go away and we should +// do the modal dialog event in some portable way. If you remove this, be +// sure to also remove the ParamTraits for it below. +struct ModalDialogEvent { +#if defined(OS_WIN) + HANDLE event; +#endif +}; + // Multi-pass include of render_messages_internal. Preprocessor magic allows // us to use 1 header to define the enums and classes for our render messages. #define IPC_MESSAGE_MACROS_ENUMS @@ -1723,6 +1735,25 @@ struct ParamTraits<webkit_glue::ScreenInfo> { } }; +template<> +struct ParamTraits<ModalDialogEvent> { + typedef ModalDialogEvent param_type; +#if defined(OS_WIN) + static void Write(Message* m, const param_type& p) { + WriteParam(m, p.event); + } + static bool Read(const Message* m, void** iter, param_type* p) { + return ReadParam(m, iter, &p->event); + } +#else + static void Write(Message* m, const param_type& p) { + } + static bool Read(const Message* m, void** iter, param_type* p) { + return true; + } +#endif +}; + } // namespace IPC #endif // CHROME_COMMON_RENDER_MESSAGES_H_ diff --git a/chrome/common/render_messages_internal.h b/chrome/common/render_messages_internal.h index 1081e54..ec0edd2 100644 --- a/chrome/common/render_messages_internal.h +++ b/chrome/common/render_messages_internal.h @@ -43,7 +43,15 @@ IPC_BEGIN_MESSAGES(View, 1) // Tells the renderer to create a new view. // This message is slightly different, the view it takes is the view to // create, the message itself is sent as a non-view control message. - IPC_MESSAGE_CONTROL4(ViewMsg_New, HWND, HANDLE, WebPreferences, int32) + IPC_MESSAGE_CONTROL4(ViewMsg_New, + HWND /* plugin_hwnd */, + HANDLE /* modal_dialog_event */, + WebPreferences /* preferences */, + int32 /* routing_id */) +#elif defined(OS_POSIX) + IPC_MESSAGE_CONTROL2(ViewMsg_New, + WebPreferences, /* preferences */ + int32 /* routing_id */) #endif // defined(OS_WIN) // Tells the renderer to set its maximum cache size to the supplied value @@ -495,7 +503,6 @@ IPC_END_MESSAGES(View) // These are messages sent from the renderer to the browser process. IPC_BEGIN_MESSAGES(ViewHost, 2) -#if defined(OS_WIN) // Sent by the renderer when it is creating a new window. The browser creates // a tab for it and responds with a ViewMsg_CreatingNew_ACK. If route_id is // MSG_ROUTING_NONE, the view couldn't be created. modal_dialog_event is set @@ -504,16 +511,7 @@ IPC_BEGIN_MESSAGES(ViewHost, 2) int /* opener_id */, bool /* user_gesture */, int /* route_id */, - HANDLE /* modal_dialog_event */) -#else // defined(OS_WIN) - // On POSIX, we don't use the cross process events for modal dialogs. At some - // point, we won't use them on any platform, but for now we just define a - // message without the last parameter. - IPC_SYNC_MESSAGE_CONTROL2_1(ViewHostMsg_CreateWindow, - int /* opener_id */, - bool /* user_gesture */, - int /* route_id */) -#endif + ModalDialogEvent /* modal_dialog_event */) // Similar to ViewHostMsg_CreateView, except used for sub-widgets, like // <select> dropdowns. This message is sent to the WebContents that @@ -523,13 +521,11 @@ IPC_BEGIN_MESSAGES(ViewHost, 2) bool /* focus on show */, int /* route_id */) -#if defined(OS_WIN) // These two messages are sent as a result of the above two, in the browser // process, from RenderWidgetHelper to RenderViewHost. IPC_MESSAGE_ROUTED2(ViewHostMsg_CreateWindowWithRoute, int /* route_id */, - HANDLE /* modal_dialog_event */) -#endif // defined(OS_WIN) + ModalDialogEvent /* modal_dialog_event */) IPC_MESSAGE_ROUTED2(ViewHostMsg_CreateWidgetWithRoute, int /* route_id */, |