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

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: Addressed final comments by nasko@, creis@. 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
« no previous file with comments | « content/browser/web_contents/web_contents_impl.cc ('k') | content/common/view_messages.h » ('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 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, int /* current_version */)
749 770
750 // External popup menus. 771 // External popup menus.
751 IPC_MESSAGE_ROUTED2(FrameMsg_SelectPopupMenuItems, 772 IPC_MESSAGE_ROUTED2(FrameMsg_SelectPopupMenuItems,
752 bool /* user canceled the popup */, 773 bool /* user canceled the popup */,
753 std::vector<int> /* selected indices */) 774 std::vector<int> /* selected indices */)
754 775
755 #elif defined(OS_MACOSX) 776 #elif defined(OS_MACOSX)
756 777
757 // External popup menus. 778 // External popup menus.
758 IPC_MESSAGE_ROUTED1(FrameMsg_SelectPopupMenuItem, 779 IPC_MESSAGE_ROUTED1(FrameMsg_SelectPopupMenuItem,
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
799 blink::WebFrameOwnerProperties /* frame_owner_properties */) 820 blink::WebFrameOwnerProperties /* frame_owner_properties */)
800 821
801 // Request to continue running the sequential focus navigation algorithm in 822 // Request to continue running the sequential focus navigation algorithm in
802 // this frame. |source_routing_id| identifies the frame that issued this 823 // 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 824 // request. This message is sent when pressing <tab> or <shift-tab> needs to
804 // find the next focusable element in a cross-process frame. 825 // find the next focusable element in a cross-process frame.
805 IPC_MESSAGE_ROUTED2(FrameMsg_AdvanceFocus, 826 IPC_MESSAGE_ROUTED2(FrameMsg_AdvanceFocus,
806 blink::WebFocusType /* type */, 827 blink::WebFocusType /* type */,
807 int32_t /* source_routing_id */) 828 int32_t /* source_routing_id */)
808 829
830 // Sent when the user wants to search for a word on the page (find-in-page).
831 IPC_MESSAGE_ROUTED3(FrameMsg_Find,
832 int /* request_id */,
833 base::string16 /* search_text */,
834 blink::WebFindOptions)
835
836 // This message notifies the renderer that the user has closed the find-in-page
837 // window (and what action to take regarding the selection).
838 IPC_MESSAGE_ROUTED1(FrameMsg_StopFinding, content::StopFindAction /* action */)
839
809 #if defined(ENABLE_PLUGINS) 840 #if defined(ENABLE_PLUGINS)
810 // Notifies the renderer of updates to the Plugin Power Saver origin whitelist. 841 // Notifies the renderer of updates to the Plugin Power Saver origin whitelist.
811 IPC_MESSAGE_ROUTED1(FrameMsg_UpdatePluginContentOriginWhitelist, 842 IPC_MESSAGE_ROUTED1(FrameMsg_UpdatePluginContentOriginWhitelist,
812 std::set<url::Origin> /* origin_whitelist */) 843 std::set<url::Origin> /* origin_whitelist */)
813 #endif // defined(ENABLE_PLUGINS) 844 #endif // defined(ENABLE_PLUGINS)
814 845
815 // ----------------------------------------------------------------------------- 846 // -----------------------------------------------------------------------------
816 // Messages sent from the renderer to the browser. 847 // Messages sent from the renderer to the browser.
817 848
818 // Blink and JavaScript error messages to log to the console 849 // Blink and JavaScript error messages to log to the console
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after
1354 1385
1355 // This message is sent from a RenderFrameProxy when sequential focus 1386 // This message is sent from a RenderFrameProxy when sequential focus
1356 // navigation needs to advance into its actual frame. |source_routing_id| 1387 // navigation needs to advance into its actual frame. |source_routing_id|
1357 // identifies the frame that issued this request. This is used when pressing 1388 // 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 1389 // <tab> or <shift-tab> hits an out-of-process iframe when searching for the
1359 // next focusable element. 1390 // next focusable element.
1360 IPC_MESSAGE_ROUTED2(FrameHostMsg_AdvanceFocus, 1391 IPC_MESSAGE_ROUTED2(FrameHostMsg_AdvanceFocus,
1361 blink::WebFocusType /* type */, 1392 blink::WebFocusType /* type */,
1362 int32_t /* source_routing_id */) 1393 int32_t /* source_routing_id */)
1363 1394
1395 // Result of string search in the document.
1396 // Response to FrameMsg_Find with the results of the requested find-in-page
1397 // search, the number of matches found and the selection rect (in screen
1398 // coordinates) for the string found. If |final_update| is false, it signals
1399 // that this is not the last Find_Reply message - more will be sent as the
1400 // scoping effort continues.
1401 IPC_MESSAGE_ROUTED5(FrameHostMsg_Find_Reply,
1402 int /* request_id */,
1403 int /* number of matches */,
1404 gfx::Rect /* selection_rect */,
1405 int /* active_match_ordinal */,
1406 bool /* final_update */)
1407
1364 #if defined(OS_MACOSX) || defined(OS_ANDROID) 1408 #if defined(OS_MACOSX) || defined(OS_ANDROID)
1365 1409
1366 // Message to show/hide a popup menu using native controls. 1410 // Message to show/hide a popup menu using native controls.
1367 IPC_MESSAGE_ROUTED1(FrameHostMsg_ShowPopup, 1411 IPC_MESSAGE_ROUTED1(FrameHostMsg_ShowPopup,
1368 FrameHostMsg_ShowPopup_Params) 1412 FrameHostMsg_ShowPopup_Params)
1369 IPC_MESSAGE_ROUTED0(FrameHostMsg_HidePopup) 1413 IPC_MESSAGE_ROUTED0(FrameHostMsg_HidePopup)
1370 1414
1371 #endif 1415 #endif
1372 1416
1417 #if defined(OS_ANDROID)
1418 // Response to FrameMsg_FindMatchRects.
1419 //
1420 // |version| will contain the current version number of the renderer's find
1421 // match list (incremented whenever they change), which should be passed in the
1422 // next call to FrameMsg_FindMatchRects.
1423 //
1424 // |rects| will either contain a list of the enclosing rects of all matches
1425 // found by the most recent Find operation, or will be empty if |version| is not
1426 // greater than the |current_version| passed to FrameMsg_FindMatchRects (hence
1427 // your locally cached rects should still be valid). The rect coords will be
1428 // custom normalized fractions of the document size. The rects will be sorted by
1429 // frame traversal order starting in the main frame, then by dom order.
1430 //
1431 // |active_rect| will contain the bounding box of the active find-in-page match
1432 // marker, in similarly normalized coords (or an empty rect if there isn't one).
1433 IPC_MESSAGE_ROUTED3(FrameHostMsg_FindMatchRects_Reply,
1434 int /* version */,
1435 std::vector<gfx::RectF> /* rects */,
1436 gfx::RectF /* active_rect */)
1437 #endif
1438
1373 // Adding a new message? Stick to the sort order above: first platform 1439 // Adding a new message? Stick to the sort order above: first platform
1374 // independent FrameMsg, then ifdefs for platform specific FrameMsg, then 1440 // independent FrameMsg, then ifdefs for platform specific FrameMsg, then
1375 // platform independent FrameHostMsg, then ifdefs for platform specific 1441 // platform independent FrameHostMsg, then ifdefs for platform specific
1376 // FrameHostMsg. 1442 // FrameHostMsg.
OLDNEW
« no previous file with comments | « content/browser/web_contents/web_contents_impl.cc ('k') | content/common/view_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698