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

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

Issue 1600953003: Move find-in-page code from RenderView to RenderFrame. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 interacting with frames. 5 // IPC messages for interacting with frames.
6 // Multiply-included message file, hence no include guard. 6 // Multiply-included message file, hence no include guard.
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 17 matching lines...) Expand all
28 #include "content/public/common/color_suggestion.h" 28 #include "content/public/common/color_suggestion.h"
29 #include "content/public/common/common_param_traits.h" 29 #include "content/public/common/common_param_traits.h"
30 #include "content/public/common/console_message_level.h" 30 #include "content/public/common/console_message_level.h"
31 #include "content/public/common/context_menu_params.h" 31 #include "content/public/common/context_menu_params.h"
32 #include "content/public/common/frame_navigate_params.h" 32 #include "content/public/common/frame_navigate_params.h"
33 #include "content/public/common/javascript_message_type.h" 33 #include "content/public/common/javascript_message_type.h"
34 #include "content/public/common/message_port_types.h" 34 #include "content/public/common/message_port_types.h"
35 #include "content/public/common/page_importance_signals.h" 35 #include "content/public/common/page_importance_signals.h"
36 #include "content/public/common/page_state.h" 36 #include "content/public/common/page_state.h"
37 #include "content/public/common/resource_response.h" 37 #include "content/public/common/resource_response.h"
38 #include "content/public/common/stop_find_action.h"
38 #include "content/public/common/three_d_api_types.h" 39 #include "content/public/common/three_d_api_types.h"
39 #include "content/public/common/transition_element.h" 40 #include "content/public/common/transition_element.h"
40 #include "ipc/ipc_message_macros.h" 41 #include "ipc/ipc_message_macros.h"
41 #include "ipc/ipc_platform_file.h" 42 #include "ipc/ipc_platform_file.h"
42 #include "third_party/WebKit/public/platform/WebFocusType.h" 43 #include "third_party/WebKit/public/platform/WebFocusType.h"
44 #include "third_party/WebKit/public/web/WebFindOptions.h"
43 #include "third_party/WebKit/public/web/WebFrameOwnerProperties.h" 45 #include "third_party/WebKit/public/web/WebFrameOwnerProperties.h"
44 #include "third_party/WebKit/public/web/WebTreeScopeType.h" 46 #include "third_party/WebKit/public/web/WebTreeScopeType.h"
45 #include "ui/gfx/ipc/gfx_param_traits.h" 47 #include "ui/gfx/ipc/gfx_param_traits.h"
46 #include "url/gurl.h" 48 #include "url/gurl.h"
47 #include "url/origin.h" 49 #include "url/origin.h"
48 50
49 #if defined(ENABLE_PLUGINS) 51 #if defined(ENABLE_PLUGINS)
50 #include "content/common/pepper_renderer_instance_data.h" 52 #include "content/common/pepper_renderer_instance_data.h"
51 #endif 53 #endif
52 54
(...skipping 24 matching lines...) Expand all
77 FrameMsg_Navigate_Type::NAVIGATE_TYPE_LAST) 79 FrameMsg_Navigate_Type::NAVIGATE_TYPE_LAST)
78 IPC_ENUM_TRAITS_MAX_VALUE(FrameMsg_UILoadMetricsReportType::Value, 80 IPC_ENUM_TRAITS_MAX_VALUE(FrameMsg_UILoadMetricsReportType::Value,
79 FrameMsg_UILoadMetricsReportType::REPORT_TYPE_LAST) 81 FrameMsg_UILoadMetricsReportType::REPORT_TYPE_LAST)
80 IPC_ENUM_TRAITS_MAX_VALUE(blink::WebContextMenuData::MediaType, 82 IPC_ENUM_TRAITS_MAX_VALUE(blink::WebContextMenuData::MediaType,
81 blink::WebContextMenuData::MediaTypeLast) 83 blink::WebContextMenuData::MediaTypeLast)
82 IPC_ENUM_TRAITS_MAX_VALUE(blink::WebContextMenuData::InputFieldType, 84 IPC_ENUM_TRAITS_MAX_VALUE(blink::WebContextMenuData::InputFieldType,
83 blink::WebContextMenuData::InputFieldTypeLast) 85 blink::WebContextMenuData::InputFieldTypeLast)
84 IPC_ENUM_TRAITS_MAX_VALUE(blink::WebFocusType, blink::WebFocusTypeLast) 86 IPC_ENUM_TRAITS_MAX_VALUE(blink::WebFocusType, blink::WebFocusTypeLast)
85 IPC_ENUM_TRAITS_MAX_VALUE(blink::WebFrameOwnerProperties::ScrollingMode, 87 IPC_ENUM_TRAITS_MAX_VALUE(blink::WebFrameOwnerProperties::ScrollingMode,
86 blink::WebFrameOwnerProperties::ScrollingMode::Last) 88 blink::WebFrameOwnerProperties::ScrollingMode::Last)
89 IPC_ENUM_TRAITS_MAX_VALUE(content::StopFindAction,
90 content::STOP_FIND_ACTION_LAST)
87 IPC_ENUM_TRAITS(blink::WebSandboxFlags) // Bitmask. 91 IPC_ENUM_TRAITS(blink::WebSandboxFlags) // Bitmask.
88 IPC_ENUM_TRAITS_MAX_VALUE(blink::WebTreeScopeType, 92 IPC_ENUM_TRAITS_MAX_VALUE(blink::WebTreeScopeType,
89 blink::WebTreeScopeType::Last) 93 blink::WebTreeScopeType::Last)
90 IPC_ENUM_TRAITS_MAX_VALUE(ui::MenuSourceType, ui::MENU_SOURCE_TYPE_LAST) 94 IPC_ENUM_TRAITS_MAX_VALUE(ui::MenuSourceType, ui::MENU_SOURCE_TYPE_LAST)
91 IPC_ENUM_TRAITS_MIN_MAX_VALUE(content::LoFiState, 95 IPC_ENUM_TRAITS_MIN_MAX_VALUE(content::LoFiState,
92 content::LOFI_UNSPECIFIED, 96 content::LOFI_UNSPECIFIED,
93 content::LOFI_ON) 97 content::LOFI_ON)
94 98
99 IPC_STRUCT_TRAITS_BEGIN(blink::WebFindOptions)
100 IPC_STRUCT_TRAITS_MEMBER(forward)
101 IPC_STRUCT_TRAITS_MEMBER(matchCase)
102 IPC_STRUCT_TRAITS_MEMBER(findNext)
103 IPC_STRUCT_TRAITS_END()
104
95 IPC_STRUCT_TRAITS_BEGIN(content::ColorSuggestion) 105 IPC_STRUCT_TRAITS_BEGIN(content::ColorSuggestion)
96 IPC_STRUCT_TRAITS_MEMBER(color) 106 IPC_STRUCT_TRAITS_MEMBER(color)
97 IPC_STRUCT_TRAITS_MEMBER(label) 107 IPC_STRUCT_TRAITS_MEMBER(label)
98 IPC_STRUCT_TRAITS_END() 108 IPC_STRUCT_TRAITS_END()
99 109
100 IPC_STRUCT_TRAITS_BEGIN(content::ContextMenuParams) 110 IPC_STRUCT_TRAITS_BEGIN(content::ContextMenuParams)
101 IPC_STRUCT_TRAITS_MEMBER(media_type) 111 IPC_STRUCT_TRAITS_MEMBER(media_type)
102 IPC_STRUCT_TRAITS_MEMBER(x) 112 IPC_STRUCT_TRAITS_MEMBER(x)
103 IPC_STRUCT_TRAITS_MEMBER(y) 113 IPC_STRUCT_TRAITS_MEMBER(y)
104 IPC_STRUCT_TRAITS_MEMBER(link_url) 114 IPC_STRUCT_TRAITS_MEMBER(link_url)
(...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after
739 749
740 // Send to the RenderFrame to set text tracks state and style settings. 750 // Send to the RenderFrame to set text tracks state and style settings.
741 // Sent for top-level frames. 751 // Sent for top-level frames.
742 IPC_MESSAGE_ROUTED1(FrameMsg_SetTextTrackSettings, 752 IPC_MESSAGE_ROUTED1(FrameMsg_SetTextTrackSettings,
743 FrameMsg_TextTrackSettings_Params /* params */) 753 FrameMsg_TextTrackSettings_Params /* params */)
744 754
745 // Posts a message from a frame in another process to the current renderer. 755 // Posts a message from a frame in another process to the current renderer.
746 IPC_MESSAGE_ROUTED1(FrameMsg_PostMessageEvent, FrameMsg_PostMessage_Params) 756 IPC_MESSAGE_ROUTED1(FrameMsg_PostMessageEvent, FrameMsg_PostMessage_Params)
747 757
748 #if defined(OS_ANDROID) 758 #if defined(OS_ANDROID)
759 // Sent when the browser wants the bounding boxes of the current find matches.
760 //
761 // If match rects are already cached on the browser side, |current_version|
762 // should be the version number from the FrameHostMsg_FindMatchRects_Reply
763 // they came in, so the renderer can tell if it needs to send updated rects.
764 // Otherwise just pass -1 to always receive the list of rects.
765 //
766 // There must be an active search string (it is probably most useful to call
767 // this immediately after a FrameHostMsg_Find_Reply message arrives with
768 // final_update set to true).
769 IPC_MESSAGE_ROUTED1(FrameMsg_FindMatchRects,
770 int /* current_version */)
749 771
750 // External popup menus. 772 // External popup menus.
751 IPC_MESSAGE_ROUTED2(FrameMsg_SelectPopupMenuItems, 773 IPC_MESSAGE_ROUTED2(FrameMsg_SelectPopupMenuItems,
752 bool /* user canceled the popup */, 774 bool /* user canceled the popup */,
753 std::vector<int> /* selected indices */) 775 std::vector<int> /* selected indices */)
754 776
755 #elif defined(OS_MACOSX) 777 #elif defined(OS_MACOSX)
756 778
757 // External popup menus. 779 // External popup menus.
758 IPC_MESSAGE_ROUTED1(FrameMsg_SelectPopupMenuItem, 780 IPC_MESSAGE_ROUTED1(FrameMsg_SelectPopupMenuItem,
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
799 blink::WebFrameOwnerProperties /* frame_owner_properties */) 821 blink::WebFrameOwnerProperties /* frame_owner_properties */)
800 822
801 // Request to continue running the sequential focus navigation algorithm in 823 // Request to continue running the sequential focus navigation algorithm in
802 // this frame. |source_routing_id| identifies the frame that issued this 824 // this frame. |source_routing_id| identifies the frame that issued this
803 // request. This message is sent when pressing <tab> or <shift-tab> needs to 825 // request. This message is sent when pressing <tab> or <shift-tab> needs to
804 // find the next focusable element in a cross-process frame. 826 // find the next focusable element in a cross-process frame.
805 IPC_MESSAGE_ROUTED2(FrameMsg_AdvanceFocus, 827 IPC_MESSAGE_ROUTED2(FrameMsg_AdvanceFocus,
806 blink::WebFocusType /* type */, 828 blink::WebFocusType /* type */,
807 int32_t /* source_routing_id */) 829 int32_t /* source_routing_id */)
808 830
831 // Sent when the user wants to search for a word on the page (find-in-page).
832 IPC_MESSAGE_ROUTED3(FrameMsg_Find,
833 int /* request_id */,
834 base::string16 /* search_text */,
835 blink::WebFindOptions)
836
837 // This message notifies the renderer that the user has closed the find-in-page
838 // window (and what action to take regarding the selection).
839 IPC_MESSAGE_ROUTED1(FrameMsg_StopFinding,
840 content::StopFindAction /* action */)
841
809 #if defined(ENABLE_PLUGINS) 842 #if defined(ENABLE_PLUGINS)
810 // Notifies the renderer of updates to the Plugin Power Saver origin whitelist. 843 // Notifies the renderer of updates to the Plugin Power Saver origin whitelist.
811 IPC_MESSAGE_ROUTED1(FrameMsg_UpdatePluginContentOriginWhitelist, 844 IPC_MESSAGE_ROUTED1(FrameMsg_UpdatePluginContentOriginWhitelist,
812 std::set<url::Origin> /* origin_whitelist */) 845 std::set<url::Origin> /* origin_whitelist */)
813 #endif // defined(ENABLE_PLUGINS) 846 #endif // defined(ENABLE_PLUGINS)
814 847
815 // ----------------------------------------------------------------------------- 848 // -----------------------------------------------------------------------------
816 // Messages sent from the renderer to the browser. 849 // Messages sent from the renderer to the browser.
817 850
818 // Blink and JavaScript error messages to log to the console 851 // Blink and JavaScript error messages to log to the console
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after
1354 1387
1355 // This message is sent from a RenderFrameProxy when sequential focus 1388 // This message is sent from a RenderFrameProxy when sequential focus
1356 // navigation needs to advance into its actual frame. |source_routing_id| 1389 // navigation needs to advance into its actual frame. |source_routing_id|
1357 // identifies the frame that issued this request. This is used when pressing 1390 // identifies the frame that issued this request. This is used when pressing
1358 // <tab> or <shift-tab> hits an out-of-process iframe when searching for the 1391 // <tab> or <shift-tab> hits an out-of-process iframe when searching for the
1359 // next focusable element. 1392 // next focusable element.
1360 IPC_MESSAGE_ROUTED2(FrameHostMsg_AdvanceFocus, 1393 IPC_MESSAGE_ROUTED2(FrameHostMsg_AdvanceFocus,
1361 blink::WebFocusType /* type */, 1394 blink::WebFocusType /* type */,
1362 int32_t /* source_routing_id */) 1395 int32_t /* source_routing_id */)
1363 1396
1397 // Result of string search in the page.
nasko 2016/01/20 21:43:32 s/page/frame/? Or document?
paulmeyer 2016/01/20 22:54:14 It will be the frame once traversal/aggregation is
1398 // Response to ViewMsg_Find with the results of the requested find-in-page
nasko 2016/01/20 21:43:32 s/ViewMsg/FrameMsg/
paulmeyer 2016/01/20 22:54:14 Done.
1399 // search, the number of matches found and the selection rect (in screen
1400 // coordinates) for the string found. If |final_update| is false, it signals
nasko 2016/01/20 21:43:32 Is the bit about "screen coordinates" still valid?
paulmeyer 2016/01/20 22:54:14 Yes.
1401 // that this is not the last Find_Reply message - more will be sent as the
1402 // scoping effort continues.
1403 IPC_MESSAGE_ROUTED5(FrameHostMsg_Find_Reply,
1404 int /* request_id */,
1405 int /* number of matches */,
1406 gfx::Rect /* selection_rect */,
1407 int /* active_match_ordinal */,
1408 bool /* final_update */)
1409
1364 #if defined(OS_MACOSX) || defined(OS_ANDROID) 1410 #if defined(OS_MACOSX) || defined(OS_ANDROID)
1365 1411
1366 // Message to show/hide a popup menu using native controls. 1412 // Message to show/hide a popup menu using native controls.
1367 IPC_MESSAGE_ROUTED1(FrameHostMsg_ShowPopup, 1413 IPC_MESSAGE_ROUTED1(FrameHostMsg_ShowPopup,
1368 FrameHostMsg_ShowPopup_Params) 1414 FrameHostMsg_ShowPopup_Params)
1369 IPC_MESSAGE_ROUTED0(FrameHostMsg_HidePopup) 1415 IPC_MESSAGE_ROUTED0(FrameHostMsg_HidePopup)
1370 1416
1371 #endif 1417 #endif
1372 1418
1419 #if defined(OS_ANDROID)
1420 // Response to FrameMsg_FindMatchRects.
1421 //
1422 // |version| will contain the current version number of the renderer's find
1423 // match list (incremented whenever they change), which should be passed in the
1424 // next call to FrameMsg_FindMatchRects.
1425 //
1426 // |rects| will either contain a list of the enclosing rects of all matches
1427 // found by the most recent Find operation, or will be empty if |version| is not
1428 // greater than the |current_version| passed to FrameMsg_FindMatchRects (hence
1429 // your locally cached rects should still be valid). The rect coords will be
1430 // custom normalized fractions of the document size. The rects will be sorted by
1431 // frame traversal order starting in the main frame, then by dom order.
nasko 2016/01/20 21:43:32 Is the comment about frame traversal order still v
paulmeyer 2016/01/20 22:54:14 Yes, for now. I could make it so that it is still
1432 //
1433 // |active_rect| will contain the bounding box of the active find-in-page match
1434 // marker, in similarly normalized coords (or an empty rect if there isn't one).
1435 IPC_MESSAGE_ROUTED3(FrameHostMsg_FindMatchRects_Reply,
1436 int /* version */,
1437 std::vector<gfx::RectF> /* rects */,
1438 gfx::RectF /* active_rect */)
1439 #endif
1440
1373 // Adding a new message? Stick to the sort order above: first platform 1441 // Adding a new message? Stick to the sort order above: first platform
1374 // independent FrameMsg, then ifdefs for platform specific FrameMsg, then 1442 // independent FrameMsg, then ifdefs for platform specific FrameMsg, then
1375 // platform independent FrameHostMsg, then ifdefs for platform specific 1443 // platform independent FrameHostMsg, then ifdefs for platform specific
1376 // FrameHostMsg. 1444 // FrameHostMsg.
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698