Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(457)

Side by Side Diff: content/common/view_messages.h

Issue 6705012: Move the rest of the content browser->renderer messages to content. Also move drag related messa... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/common/drag_messages.h ('k') | content/content_common.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 // IPC messages for page rendering. 5 // IPC messages for page rendering.
6 // Multiply-included message file, hence no include guard. 6 // Multiply-included message file, hence no include guard.
7 7
8 #include "content/common/common_param_traits.h" 8 #include "content/common/common_param_traits.h"
9 #include "content/common/css_colors.h" 9 #include "content/common/css_colors.h"
10 #include "content/common/edit_command.h" 10 #include "content/common/edit_command.h"
11 #include "content/common/page_transition_types.h" 11 #include "content/common/page_transition_types.h"
12 #include "content/common/page_zoom.h" 12 #include "content/common/page_zoom.h"
13 #include "content/common/renderer_preferences.h" 13 #include "content/common/renderer_preferences.h"
14 #include "ipc/ipc_message_macros.h" 14 #include "ipc/ipc_message_macros.h"
15 #include "ipc/ipc_platform_file.h"
16 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCompositionUnderli ne.h"
15 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFindOptions.h" 17 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFindOptions.h"
16 #include "third_party/WebKit/Source/WebKit/chromium/public/WebMediaPlayerAction. h" 18 #include "third_party/WebKit/Source/WebKit/chromium/public/WebMediaPlayerAction. h"
17 #include "ui/gfx/rect.h" 19 #include "ui/gfx/rect.h"
18 #include "webkit/glue/context_menu.h" 20 #include "webkit/glue/context_menu.h"
19 #include "webkit/glue/webmenuitem.h" 21 #include "webkit/glue/webmenuitem.h"
20 #include "webkit/glue/webpreferences.h" 22 #include "webkit/glue/webpreferences.h"
21 23
22 // Define enums used in this file inside an include-guard. 24 // Define enums used in this file inside an include-guard.
23 #ifndef CONTENT_COMMON_VIEW_MESSAGES_H_ 25 #ifndef CONTENT_COMMON_VIEW_MESSAGES_H_
24 #define CONTENT_COMMON_VIEW_MESSAGES_H_ 26 #define CONTENT_COMMON_VIEW_MESSAGES_H_
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 IPC_STRUCT_TRAITS_MEMBER(inactive_selection_bg_color) 97 IPC_STRUCT_TRAITS_MEMBER(inactive_selection_bg_color)
96 IPC_STRUCT_TRAITS_MEMBER(inactive_selection_fg_color) 98 IPC_STRUCT_TRAITS_MEMBER(inactive_selection_fg_color)
97 IPC_STRUCT_TRAITS_MEMBER(browser_handles_top_level_requests) 99 IPC_STRUCT_TRAITS_MEMBER(browser_handles_top_level_requests)
98 IPC_STRUCT_TRAITS_MEMBER(caret_blink_interval) 100 IPC_STRUCT_TRAITS_MEMBER(caret_blink_interval)
99 IPC_STRUCT_TRAITS_END() 101 IPC_STRUCT_TRAITS_END()
100 102
101 IPC_STRUCT_TRAITS_BEGIN(ViewMsg_StopFinding_Params) 103 IPC_STRUCT_TRAITS_BEGIN(ViewMsg_StopFinding_Params)
102 IPC_STRUCT_TRAITS_MEMBER(action) 104 IPC_STRUCT_TRAITS_MEMBER(action)
103 IPC_STRUCT_TRAITS_END() 105 IPC_STRUCT_TRAITS_END()
104 106
107 IPC_STRUCT_TRAITS_BEGIN(WebKit::WebCompositionUnderline)
108 IPC_STRUCT_TRAITS_MEMBER(startOffset)
109 IPC_STRUCT_TRAITS_MEMBER(endOffset)
110 IPC_STRUCT_TRAITS_MEMBER(color)
111 IPC_STRUCT_TRAITS_MEMBER(thick)
112 IPC_STRUCT_TRAITS_END()
113
105 IPC_STRUCT_TRAITS_BEGIN(WebKit::WebFindOptions) 114 IPC_STRUCT_TRAITS_BEGIN(WebKit::WebFindOptions)
106 IPC_STRUCT_TRAITS_MEMBER(forward) 115 IPC_STRUCT_TRAITS_MEMBER(forward)
107 IPC_STRUCT_TRAITS_MEMBER(matchCase) 116 IPC_STRUCT_TRAITS_MEMBER(matchCase)
108 IPC_STRUCT_TRAITS_MEMBER(findNext) 117 IPC_STRUCT_TRAITS_MEMBER(findNext)
109 IPC_STRUCT_TRAITS_END() 118 IPC_STRUCT_TRAITS_END()
110 119
111 IPC_STRUCT_TRAITS_BEGIN(WebKit::WebMediaPlayerAction) 120 IPC_STRUCT_TRAITS_BEGIN(WebKit::WebMediaPlayerAction)
112 IPC_STRUCT_TRAITS_MEMBER(type) 121 IPC_STRUCT_TRAITS_MEMBER(type)
113 IPC_STRUCT_TRAITS_MEMBER(enable) 122 IPC_STRUCT_TRAITS_MEMBER(enable)
114 IPC_STRUCT_TRAITS_END() 123 IPC_STRUCT_TRAITS_END()
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 IPC_STRUCT_TRAITS_MEMBER(writing_direction_left_to_right) 219 IPC_STRUCT_TRAITS_MEMBER(writing_direction_left_to_right)
211 IPC_STRUCT_TRAITS_MEMBER(writing_direction_right_to_left) 220 IPC_STRUCT_TRAITS_MEMBER(writing_direction_right_to_left)
212 #endif // OS_MACOSX 221 #endif // OS_MACOSX
213 IPC_STRUCT_TRAITS_MEMBER(edit_flags) 222 IPC_STRUCT_TRAITS_MEMBER(edit_flags)
214 IPC_STRUCT_TRAITS_MEMBER(security_info) 223 IPC_STRUCT_TRAITS_MEMBER(security_info)
215 IPC_STRUCT_TRAITS_MEMBER(frame_charset) 224 IPC_STRUCT_TRAITS_MEMBER(frame_charset)
216 IPC_STRUCT_TRAITS_MEMBER(custom_context) 225 IPC_STRUCT_TRAITS_MEMBER(custom_context)
217 IPC_STRUCT_TRAITS_MEMBER(custom_items) 226 IPC_STRUCT_TRAITS_MEMBER(custom_items)
218 IPC_STRUCT_TRAITS_END() 227 IPC_STRUCT_TRAITS_END()
219 228
229 IPC_STRUCT_BEGIN(ViewMsg_ClosePage_Params)
230 // The identifier of the RenderProcessHost for the currently closing view.
231 //
232 // These first two parameters are technically redundant since they are
233 // needed only when processing the ACK message, and the processor
234 // theoretically knows both the process and route ID. However, this is
235 // difficult to figure out with our current implementation, so this
236 // information is duplicate here.
237 IPC_STRUCT_MEMBER(int, closing_process_id)
238
239 // The route identifier for the currently closing RenderView.
240 IPC_STRUCT_MEMBER(int, closing_route_id)
241
242 // True when this close is for the first (closing) tab of a cross-site
243 // transition where we switch processes. False indicates the close is for the
244 // entire tab.
245 //
246 // When true, the new_* variables below must be filled in. Otherwise they must
247 // both be -1.
248 IPC_STRUCT_MEMBER(bool, for_cross_site_transition)
249
250 // The identifier of the RenderProcessHost for the new view attempting to
251 // replace the closing one above. This must be valid when
252 // for_cross_site_transition is set, and must be -1 otherwise.
253 IPC_STRUCT_MEMBER(int, new_render_process_host_id)
254
255 // The identifier of the *request* the new view made that is causing the
256 // cross-site transition. This is *not* a route_id, but the request that we
257 // will resume once the ACK from the closing view has been received. This
258 // must be valid when for_cross_site_transition is set, and must be -1
259 // otherwise.
260 IPC_STRUCT_MEMBER(int, new_request_id)
261 IPC_STRUCT_END()
262
263 IPC_STRUCT_BEGIN(ViewHostMsg_CreateWorker_Params)
264 // URL for the worker script.
265 IPC_STRUCT_MEMBER(GURL, url)
266
267 // True if this is a SharedWorker, false if it is a dedicated Worker.
268 IPC_STRUCT_MEMBER(bool, is_shared)
269
270 // Name for a SharedWorker, otherwise empty string.
271 IPC_STRUCT_MEMBER(string16, name)
272
273 // The ID of the parent document (unique within parent renderer).
274 IPC_STRUCT_MEMBER(unsigned long long, document_id)
275
276 // RenderView routing id used to send messages back to the parent.
277 IPC_STRUCT_MEMBER(int, render_view_route_id)
278
279 // The route ID to associate with the worker. If MSG_ROUTING_NONE is passed,
280 // a new unique ID is created and assigned to the worker.
281 IPC_STRUCT_MEMBER(int, route_id)
282
283 // The ID of the parent's appcache host, only valid for dedicated workers.
284 IPC_STRUCT_MEMBER(int, parent_appcache_host_id)
285
286 // The ID of the appcache the main shared worker script resource was loaded
287 // from, only valid for shared workers.
288 IPC_STRUCT_MEMBER(int64, script_resource_appcache_id)
289 IPC_STRUCT_END()
290
220 IPC_STRUCT_BEGIN(ViewMsg_Navigate_Params) 291 IPC_STRUCT_BEGIN(ViewMsg_Navigate_Params)
221 // The page_id for this navigation, or -1 if it is a new navigation. Back, 292 // The page_id for this navigation, or -1 if it is a new navigation. Back,
222 // Forward, and Reload navigations should have a valid page_id. If the load 293 // Forward, and Reload navigations should have a valid page_id. If the load
223 // succeeds, then this page_id will be reflected in the resultant 294 // succeeds, then this page_id will be reflected in the resultant
224 // ViewHostMsg_FrameNavigate message. 295 // ViewHostMsg_FrameNavigate message.
225 IPC_STRUCT_MEMBER(int32, page_id) 296 IPC_STRUCT_MEMBER(int32, page_id)
226 297
227 // If page_id is -1, then pending_history_list_offset will also be -1. 298 // If page_id is -1, then pending_history_list_offset will also be -1.
228 // Otherwise, it contains the offset into the history list corresponding to 299 // Otherwise, it contains the offset into the history list corresponding to
229 // the current navigation. 300 // the current navigation.
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
550 IPC_MESSAGE_ROUTED2(ViewMsg_SetZoomLevelForLoadingURL, 621 IPC_MESSAGE_ROUTED2(ViewMsg_SetZoomLevelForLoadingURL,
551 GURL /* url */, 622 GURL /* url */,
552 double /* zoom_level */) 623 double /* zoom_level */)
553 624
554 // Set the zoom level for a particular url, so all render views 625 // Set the zoom level for a particular url, so all render views
555 // displaying this url can update their zoom levels to match. 626 // displaying this url can update their zoom levels to match.
556 IPC_MESSAGE_CONTROL2(ViewMsg_SetZoomLevelForCurrentURL, 627 IPC_MESSAGE_CONTROL2(ViewMsg_SetZoomLevelForCurrentURL,
557 GURL /* url */, 628 GURL /* url */,
558 double /* zoom_level */) 629 double /* zoom_level */)
559 630
631 // Change encoding of page in the renderer.
632 IPC_MESSAGE_ROUTED1(ViewMsg_SetPageEncoding,
633 std::string /*new encoding name*/)
634
635 // Reset encoding of page in the renderer back to default.
636 IPC_MESSAGE_ROUTED0(ViewMsg_ResetPageEncodingToDefault)
637
638 // Requests the renderer to reserve a range of page ids.
639 IPC_MESSAGE_ROUTED1(ViewMsg_ReservePageIDRange,
640 int /* size_of_range */)
641
642 // Used to tell a render view whether it should expose various bindings
643 // that allow JS content extended privileges. See BindingsPolicy for valid
644 // flag values.
645 IPC_MESSAGE_ROUTED1(ViewMsg_AllowBindings,
646 int /* enabled_bindings_flags */)
647
648 // Tell the renderer to add a property to the WebUI binding object. This
649 // only works if we allowed WebUI bindings.
650 IPC_MESSAGE_ROUTED2(ViewMsg_SetWebUIProperty,
651 std::string /* property_name */,
652 std::string /* property_value_json */)
653
654 // This message starts/stop monitoring the input method status of the focused
655 // edit control of a renderer process.
656 // Parameters
657 // * is_active (bool)
658 // Indicates if an input method is active in the browser process.
659 // The possible actions when a renderer process receives this message are
660 // listed below:
661 // Value Action
662 // true Start sending IPC message ViewHostMsg_ImeUpdateTextInputState
663 // to notify the input method status of the focused edit control.
664 // false Stop sending IPC message ViewHostMsg_ImeUpdateTextInputState.
665 IPC_MESSAGE_ROUTED1(ViewMsg_SetInputMethodActive,
666 bool /* is_active */)
667
668 // This message sends a string being composed with an input method.
669 IPC_MESSAGE_ROUTED4(
670 ViewMsg_ImeSetComposition,
671 string16, /* text */
672 std::vector<WebKit::WebCompositionUnderline>, /* underlines */
673 int, /* selectiont_start */
674 int /* selection_end */)
675
676 // This message confirms an ongoing composition.
677 IPC_MESSAGE_ROUTED1(ViewMsg_ImeConfirmComposition,
678 string16 /* text */)
679
680 // Used to notify the render-view that we have received a target URL. Used
681 // to prevent target URLs spamming the browser.
682 IPC_MESSAGE_ROUTED0(ViewMsg_UpdateTargetURL_ACK)
683
684
685 // Sets the alternate error page URL (link doctor) for the renderer process.
686 IPC_MESSAGE_ROUTED1(ViewMsg_SetAltErrorPageURL,
687 GURL)
688
689 IPC_MESSAGE_ROUTED1(ViewMsg_RunFileChooserResponse,
690 std::vector<FilePath> /* selected files */)
691
692 // When a renderer sends a ViewHostMsg_Focus to the browser process,
693 // the browser has the option of sending a ViewMsg_CantFocus back to
694 // the renderer.
695 IPC_MESSAGE_ROUTED0(ViewMsg_CantFocus)
696
697 // Instructs the renderer to invoke the frame's shouldClose method, which
698 // runs the onbeforeunload event handler. Expects the result to be returned
699 // via ViewHostMsg_ShouldClose.
700 IPC_MESSAGE_ROUTED0(ViewMsg_ShouldClose)
701
702 // Instructs the renderer to close the current page, including running the
703 // onunload event handler. See the struct in render_messages.h for more.
704 //
705 // Expects a ClosePage_ACK message when finished, where the parameters are
706 // echoed back.
707 IPC_MESSAGE_ROUTED1(ViewMsg_ClosePage,
708 ViewMsg_ClosePage_Params)
709
710 // Notifies the renderer about ui theme changes
711 IPC_MESSAGE_ROUTED0(ViewMsg_ThemeChanged)
712
713 // Notifies the renderer that a paint is to be generated for the rectangle
714 // passed in.
715 IPC_MESSAGE_ROUTED1(ViewMsg_Repaint,
716 gfx::Size /* The view size to be repainted */)
717
718 // Notification that a move or resize renderer's containing window has
719 // started.
720 IPC_MESSAGE_ROUTED0(ViewMsg_MoveOrResizeStarted)
721
722 // Reply to ViewHostMsg_RequestMove, ViewHostMsg_ShowView, and
723 // ViewHostMsg_ShowWidget to inform the renderer that the browser has
724 // processed the move. The browser may have ignored the move, but it finished
725 // processing. This is used because the renderer keeps a temporary cache of
726 // the widget position while these asynchronous operations are in progress.
727 IPC_MESSAGE_ROUTED0(ViewMsg_Move_ACK)
728
729 // Used to instruct the RenderView to send back updates to the preferred size.
730 IPC_MESSAGE_ROUTED1(ViewMsg_EnablePreferredSizeChangedMode,
731 int /*flags*/)
732
733 // Changes the text direction of the currently selected input field (if any).
734 IPC_MESSAGE_ROUTED1(ViewMsg_SetTextDirection,
735 WebKit::WebTextDirection /* direction */)
736
737 // Tells the renderer to clear the focused node (if any).
738 IPC_MESSAGE_ROUTED0(ViewMsg_ClearFocusedNode)
739
740 // Make the RenderView transparent and render it onto a custom background. The
741 // background will be tiled in both directions if it is not large enough.
742 IPC_MESSAGE_ROUTED1(ViewMsg_SetBackground,
743 SkBitmap /* background */)
744
745 // Used to tell the renderer not to add scrollbars with height and
746 // width below a threshold.
747 IPC_MESSAGE_ROUTED1(ViewMsg_DisableScrollbarsForSmallWindows,
748 gfx::Size /* disable_scrollbar_size_limit */)
749
750 // Activate/deactivate the RenderView (i.e., set its controls' tint
751 // accordingly, etc.).
752 IPC_MESSAGE_ROUTED1(ViewMsg_SetActive,
753 bool /* active */)
754
755 #if defined(OS_MACOSX)
756 // Let the RenderView know its window has changed visibility.
757 IPC_MESSAGE_ROUTED1(ViewMsg_SetWindowVisibility,
758 bool /* visibile */)
759
760 // Let the RenderView know its window's frame has changed.
761 IPC_MESSAGE_ROUTED2(ViewMsg_WindowFrameChanged,
762 gfx::Rect /* window frame */,
763 gfx::Rect /* content view frame */)
764
765 // Tell the renderer that plugin IME has completed.
766 IPC_MESSAGE_ROUTED2(ViewMsg_PluginImeCompositionCompleted,
767 string16 /* text */,
768 int /* plugin_id */)
769 #endif
770
771 // Response message to ViewHostMsg_CreateShared/DedicatedWorker.
772 // Sent when the worker has started.
773 IPC_MESSAGE_ROUTED0(ViewMsg_WorkerCreated)
774
775 // The response to ViewHostMsg_AsyncOpenFile.
776 IPC_MESSAGE_ROUTED3(ViewMsg_AsyncOpenFile_ACK,
777 base::PlatformFileError /* error_code */,
778 IPC::PlatformFileForTransit /* file descriptor */,
779 int /* message_id */)
780
781 // Tells the renderer that the network state has changed and that
782 // window.navigator.onLine should be updated for all WebViews.
783 IPC_MESSAGE_ROUTED1(ViewMsg_NetworkStateChanged,
784 bool /* online */)
560 785
561 786
562 // Messages sent from the renderer to the browser. 787 // Messages sent from the renderer to the browser.
563 788
564 // Used to tell the parent that the user right clicked on an area of the 789 // Used to tell the parent that the user right clicked on an area of the
565 // content area, and a context menu should be shown for it. The params 790 // content area, and a context menu should be shown for it. The params
566 // object contains information about the node(s) that were selected when the 791 // object contains information about the node(s) that were selected when the
567 // user right clicked. 792 // user right clicked.
568 IPC_MESSAGE_ROUTED1(ViewHostMsg_ContextMenu, ContextMenuParams) 793 IPC_MESSAGE_ROUTED1(ViewHostMsg_ContextMenu, ContextMenuParams)
569 794
(...skipping 14 matching lines...) Expand all
584 // search, the number of matches found and the selection rect (in screen 809 // search, the number of matches found and the selection rect (in screen
585 // coordinates) for the string found. If |final_update| is false, it signals 810 // coordinates) for the string found. If |final_update| is false, it signals
586 // that this is not the last Find_Reply message - more will be sent as the 811 // that this is not the last Find_Reply message - more will be sent as the
587 // scoping effort continues. 812 // scoping effort continues.
588 IPC_MESSAGE_ROUTED5(ViewHostMsg_Find_Reply, 813 IPC_MESSAGE_ROUTED5(ViewHostMsg_Find_Reply,
589 int /* request_id */, 814 int /* request_id */,
590 int /* number of matches */, 815 int /* number of matches */,
591 gfx::Rect /* selection_rect */, 816 gfx::Rect /* selection_rect */,
592 int /* active_match_ordinal */, 817 int /* active_match_ordinal */,
593 bool /* final_update */) 818 bool /* final_update */)
819
820 // Provides the result from running OnMsgShouldClose. |proceed| matches the
821 // return value of the the frame's shouldClose method (which includes the
822 // onbeforeunload handler): true if the user decided to proceed with leaving
823 // the page.
824 IPC_MESSAGE_ROUTED1(ViewHostMsg_ShouldClose_ACK,
825 bool /* proceed */)
826
827 // Indicates that the current page has been closed, after a ClosePage
828 // message. The parameters are just echoed from the ClosePage request.
829 IPC_MESSAGE_ROUTED1(ViewHostMsg_ClosePage_ACK,
830 ViewMsg_ClosePage_Params)
831
832
833 // A renderer sends this to the browser process when it wants to create a
834 // worker. The browser will create the worker process if necessary, and
835 // will return the route id on success. On error returns MSG_ROUTING_NONE.
836 IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_CreateWorker,
837 ViewHostMsg_CreateWorker_Params,
838 int /* route_id */)
839
840 // This message is sent to the browser to see if an instance of this shared
841 // worker already exists. If so, it returns exists == true. If a
842 // non-empty name is passed, also validates that the url matches the url of
843 // the existing worker. If a matching worker is found, the passed-in
844 // document_id is associated with that worker, to ensure that the worker
845 // stays alive until the document is detached.
846 // The route_id returned can be used to forward messages to the worker via
847 // ForwardToWorker if it exists, otherwise it should be passed in to any
848 // future call to CreateWorker to avoid creating duplicate workers.
849 IPC_SYNC_MESSAGE_CONTROL1_3(ViewHostMsg_LookupSharedWorker,
850 ViewHostMsg_CreateWorker_Params,
851 bool /* exists */,
852 int /* route_id */,
853 bool /* url_mismatch */)
854
855 // A renderer sends this to the browser process when a document has been
856 // detached. The browser will use this to constrain the lifecycle of worker
857 // processes (SharedWorkers are shut down when their last associated document
858 // is detached).
859 IPC_MESSAGE_CONTROL1(ViewHostMsg_DocumentDetached,
860 uint64 /* document_id */)
861
862 // Wraps an IPC message that's destined to the worker on the renderer->browser
863 // hop.
864 IPC_MESSAGE_CONTROL1(ViewHostMsg_ForwardToWorker,
865 IPC::Message /* message */)
866
867 // Sent if the worker object has sent a ViewHostMsg_CreateDedicatedWorker
868 // message and not received a ViewMsg_WorkerCreated reply, but in the
869 // mean time it's destroyed. This tells the browser to not create the queued
870 // worker.
871 IPC_MESSAGE_CONTROL1(ViewHostMsg_CancelCreateDedicatedWorker,
872 int /* route_id */)
OLDNEW
« no previous file with comments | « content/common/drag_messages.h ('k') | content/content_common.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698