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

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

Issue 10941015: [Android] Upstream the WebView find-in-page API implementation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review fixes. Created 8 years, 3 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "base/process.h" 8 #include "base/process.h"
9 #include "base/shared_memory.h" 9 #include "base/shared_memory.h"
10 #include "content/common/content_export.h" 10 #include "content/common/content_export.h"
(...skipping 830 matching lines...) Expand 10 before | Expand all | Expand 10 after
841 IPC_SYNC_MESSAGE_CONTROL0_1(ViewHostMsg_GetMonitorColorProfile, 841 IPC_SYNC_MESSAGE_CONTROL0_1(ViewHostMsg_GetMonitorColorProfile,
842 std::vector<char> /* profile */) 842 std::vector<char> /* profile */)
843 843
844 // Tells the renderer to create a new view. 844 // Tells the renderer to create a new view.
845 // This message is slightly different, the view it takes (via 845 // This message is slightly different, the view it takes (via
846 // ViewMsg_New_Params) is the view to create, the message itself is sent as a 846 // ViewMsg_New_Params) is the view to create, the message itself is sent as a
847 // non-view control message. 847 // non-view control message.
848 IPC_MESSAGE_CONTROL1(ViewMsg_New, 848 IPC_MESSAGE_CONTROL1(ViewMsg_New,
849 ViewMsg_New_Params) 849 ViewMsg_New_Params)
850 850
851 #if defined(OS_ANDROID)
852 // Sent when the user clicks on the find result bar to activate a find result.
853 // The point (x,y) is in fractions of the content document's width and height.
854 IPC_MESSAGE_ROUTED3(ViewMsg_ActivateNearestFindResult,
855 int /* request_id */,
856 float /* x */,
857 float /* y */)
858
859 // Sent when the browser wants the bounding boxes of the current find matches.
860 //
861 // If match rects are already cached on the browser side, |current_version|
862 // should be the version number from the ViewHostMsg_FindMatchRects_Reply
863 // they came in, so the renderer can tell if it needs to send updated rects.
864 // Otherwise just pass -1 to always receive the list of rects.
865 //
866 // There must be an active search string (it is probably most useful to call
867 // this immediately after a ViewHostMsg_Find_Reply message arrives with
868 // final_update set to true).
869 IPC_MESSAGE_ROUTED1(ViewMsg_FindMatchRects,
870 int /* current_version */)
871 #endif
872
873 // Reply in response to ViewHostMsg_ShowView or ViewHostMsg_ShowWidget. 851 // Reply in response to ViewHostMsg_ShowView or ViewHostMsg_ShowWidget.
874 // similar to the new command, but used when the renderer created a view 852 // similar to the new command, but used when the renderer created a view
875 // first, and we need to update it. 853 // first, and we need to update it.
876 IPC_MESSAGE_ROUTED1(ViewMsg_CreatingNew_ACK, 854 IPC_MESSAGE_ROUTED1(ViewMsg_CreatingNew_ACK,
877 gfx::NativeViewId /* parent_hwnd */) 855 gfx::NativeViewId /* parent_hwnd */)
878 856
879 // Sends updated preferences to the renderer. 857 // Sends updated preferences to the renderer.
880 IPC_MESSAGE_ROUTED1(ViewMsg_SetRendererPrefs, 858 IPC_MESSAGE_ROUTED1(ViewMsg_SetRendererPrefs,
881 content::RendererPreferences) 859 content::RendererPreferences)
882 860
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
1108 int, /* route_id of the active renderer */ 1086 int, /* route_id of the active renderer */
1109 std::string /* json encoded frame tree */) 1087 std::string /* json encoded frame tree */)
1110 1088
1111 // Request for the renderer to evaluate an xpath to a frame and insert css 1089 // Request for the renderer to evaluate an xpath to a frame and insert css
1112 // into that frame's document. See ViewMsg_ScriptEvalRequest for details on 1090 // into that frame's document. See ViewMsg_ScriptEvalRequest for details on
1113 // allowed xpath expressions. 1091 // allowed xpath expressions.
1114 IPC_MESSAGE_ROUTED2(ViewMsg_CSSInsertRequest, 1092 IPC_MESSAGE_ROUTED2(ViewMsg_CSSInsertRequest,
1115 string16, /* frame_xpath */ 1093 string16, /* frame_xpath */
1116 std::string /* css string */) 1094 std::string /* css string */)
1117 1095
1118 // External popup menus.
1119 #if defined(OS_MACOSX)
1120 IPC_MESSAGE_ROUTED1(ViewMsg_SelectPopupMenuItem,
1121 int /* selected index, -1 means no selection */)
1122 #elif defined(OS_ANDROID)
1123 IPC_MESSAGE_ROUTED2(ViewMsg_SelectPopupMenuItems,
1124 bool /* user canceled the popup */,
1125 std::vector<int> /* selected indices */)
1126 #endif
1127
1128 // Change the zoom level for the current main frame. If the level actually 1096 // Change the zoom level for the current main frame. If the level actually
1129 // changes, a ViewHostMsg_DidZoomURL message will be sent back to the browser 1097 // changes, a ViewHostMsg_DidZoomURL message will be sent back to the browser
1130 // telling it what url got zoomed and what its current zoom level is. 1098 // telling it what url got zoomed and what its current zoom level is.
1131 IPC_MESSAGE_ROUTED1(ViewMsg_Zoom, 1099 IPC_MESSAGE_ROUTED1(ViewMsg_Zoom,
1132 content::PageZoom /* function */) 1100 content::PageZoom /* function */)
1133 1101
1134 // Set the zoom level for the current main frame. If the level actually 1102 // Set the zoom level for the current main frame. If the level actually
1135 // changes, a ViewHostMsg_DidZoomURL message will be sent back to the browser 1103 // changes, a ViewHostMsg_DidZoomURL message will be sent back to the browser
1136 // telling it what url got zoomed and what its current zoom level is. 1104 // telling it what url got zoomed and what its current zoom level is.
1137 IPC_MESSAGE_ROUTED1(ViewMsg_SetZoomLevel, 1105 IPC_MESSAGE_ROUTED1(ViewMsg_SetZoomLevel,
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
1325 gfx::Size /* disable_scrollbar_size_limit */) 1293 gfx::Size /* disable_scrollbar_size_limit */)
1326 1294
1327 // Activate/deactivate the RenderView (i.e., set its controls' tint 1295 // Activate/deactivate the RenderView (i.e., set its controls' tint
1328 // accordingly, etc.). 1296 // accordingly, etc.).
1329 IPC_MESSAGE_ROUTED1(ViewMsg_SetActive, 1297 IPC_MESSAGE_ROUTED1(ViewMsg_SetActive,
1330 bool /* active */) 1298 bool /* active */)
1331 1299
1332 IPC_MESSAGE_ROUTED1(ViewMsg_SetNavigationStartTime, 1300 IPC_MESSAGE_ROUTED1(ViewMsg_SetNavigationStartTime,
1333 base::TimeTicks /* browser_navigation_start */) 1301 base::TimeTicks /* browser_navigation_start */)
1334 1302
1335 #if defined(OS_MACOSX)
1336 // Let the RenderView know its window has changed visibility.
1337 IPC_MESSAGE_ROUTED1(ViewMsg_SetWindowVisibility,
1338 bool /* visibile */)
1339
1340 // Let the RenderView know its window's frame has changed.
1341 IPC_MESSAGE_ROUTED2(ViewMsg_WindowFrameChanged,
1342 gfx::Rect /* window frame */,
1343 gfx::Rect /* content view frame */)
1344
1345 // Message sent from the browser to the renderer when the user starts or stops
1346 // resizing the view.
1347 IPC_MESSAGE_ROUTED1(ViewMsg_SetInLiveResize,
1348 bool /* enable */)
1349
1350 // Tell the renderer that plugin IME has completed.
1351 IPC_MESSAGE_ROUTED2(ViewMsg_PluginImeCompositionCompleted,
1352 string16 /* text */,
1353 int /* plugin_id */)
1354 #endif
1355
1356 // Response message to ViewHostMsg_CreateShared/DedicatedWorker. 1303 // Response message to ViewHostMsg_CreateShared/DedicatedWorker.
1357 // Sent when the worker has started. 1304 // Sent when the worker has started.
1358 IPC_MESSAGE_ROUTED0(ViewMsg_WorkerCreated) 1305 IPC_MESSAGE_ROUTED0(ViewMsg_WorkerCreated)
1359 1306
1360 // The response to ViewHostMsg_AsyncOpenFile. 1307 // The response to ViewHostMsg_AsyncOpenFile.
1361 IPC_MESSAGE_ROUTED3(ViewMsg_AsyncOpenFile_ACK, 1308 IPC_MESSAGE_ROUTED3(ViewMsg_AsyncOpenFile_ACK,
1362 base::PlatformFileError /* error_code */, 1309 base::PlatformFileError /* error_code */,
1363 IPC::PlatformFileForTransit /* file descriptor */, 1310 IPC::PlatformFileForTransit /* file descriptor */,
1364 int /* message_id */) 1311 int /* message_id */)
1365 1312
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
1400 IPC::PlatformFileForTransit /* file handle */) 1347 IPC::PlatformFileForTransit /* file handle */)
1401 1348
1402 // Temporary message to diagnose an unexpected condition in WebContentsImpl. 1349 // Temporary message to diagnose an unexpected condition in WebContentsImpl.
1403 IPC_MESSAGE_CONTROL1(ViewMsg_TempCrashWithData, 1350 IPC_MESSAGE_CONTROL1(ViewMsg_TempCrashWithData,
1404 GURL /* data */) 1351 GURL /* data */)
1405 1352
1406 // Change the accessibility mode in the renderer process. 1353 // Change the accessibility mode in the renderer process.
1407 IPC_MESSAGE_ROUTED1(ViewMsg_SetAccessibilityMode, 1354 IPC_MESSAGE_ROUTED1(ViewMsg_SetAccessibilityMode,
1408 AccessibilityMode) 1355 AccessibilityMode)
1409 1356
1357 #if defined(OS_ANDROID)
1358 // Sent when the user clicks on the find result bar to activate a find result.
1359 // The point (x,y) is in fractions of the content document's width and height.
1360 IPC_MESSAGE_ROUTED3(ViewMsg_ActivateNearestFindResult,
1361 int /* request_id */,
1362 float /* x */,
1363 float /* y */)
1364
1365 // Sent when the browser wants the bounding boxes of the current find matches.
1366 //
1367 // If match rects are already cached on the browser side, |current_version|
1368 // should be the version number from the ViewHostMsg_FindMatchRects_Reply
1369 // they came in, so the renderer can tell if it needs to send updated rects.
1370 // Otherwise just pass -1 to always receive the list of rects.
1371 //
1372 // There must be an active search string (it is probably most useful to call
1373 // this immediately after a ViewHostMsg_Find_Reply message arrives with
1374 // final_update set to true).
1375 IPC_MESSAGE_ROUTED1(ViewMsg_FindMatchRects,
1376 int /* current_version */)
1377
1378 // Sent when the user wants to search for all occurrences of a word or find
1379 // the next result in a synchronous way. This method forces the UI thread in
1380 // the browser to wait for the renderer to reply, therefore blocking the UI.
1381 //
1382 // This functionality is required for compatibility with the legacy Android
1383 // WebView API. As this goes strongly against the Chromium design guidelines,
1384 // don't use this as inspiration.
1385 //
1386 IPC_SYNC_MESSAGE_ROUTED3_2(ViewMsg_SynchronousFind,
1387 int /* request_id */,
1388 string16 /* search_string */,
1389 WebKit::WebFindOptions /* options */,
1390 int /* match_count */,
1391 int /* active_ordinal */)
1392
1393 // External popup menus.
1394 IPC_MESSAGE_ROUTED2(ViewMsg_SelectPopupMenuItems,
1395 bool /* user canceled the popup */,
1396 std::vector<int> /* selected indices */)
1397 #elif defined(OS_MACOSX)
1398 // Let the RenderView know its window has changed visibility.
1399 IPC_MESSAGE_ROUTED1(ViewMsg_SetWindowVisibility,
1400 bool /* visibile */)
1401
1402 // Let the RenderView know its window's frame has changed.
1403 IPC_MESSAGE_ROUTED2(ViewMsg_WindowFrameChanged,
1404 gfx::Rect /* window frame */,
1405 gfx::Rect /* content view frame */)
1406
1407 // Message sent from the browser to the renderer when the user starts or stops
1408 // resizing the view.
1409 IPC_MESSAGE_ROUTED1(ViewMsg_SetInLiveResize,
1410 bool /* enable */)
1411
1412 // Tell the renderer that plugin IME has completed.
1413 IPC_MESSAGE_ROUTED2(ViewMsg_PluginImeCompositionCompleted,
1414 string16 /* text */,
1415 int /* plugin_id */)
1416
1417 // External popup menus.
1418 IPC_MESSAGE_ROUTED1(ViewMsg_SelectPopupMenuItem,
1419 int /* selected index, -1 means no selection */)
1420 #endif
1421
1422
1410 // ----------------------------------------------------------------------------- 1423 // -----------------------------------------------------------------------------
1411 // Messages sent from the renderer to the browser. 1424 // Messages sent from the renderer to the browser.
1412 1425
1413 // Sent by the renderer when it is creating a new window. The browser creates 1426 // Sent by the renderer when it is creating a new window. The browser creates
1414 // a tab for it and responds with a ViewMsg_CreatingNew_ACK. If route_id is 1427 // a tab for it and responds with a ViewMsg_CreatingNew_ACK. If route_id is
1415 // MSG_ROUTING_NONE, the view couldn't be created. 1428 // MSG_ROUTING_NONE, the view couldn't be created.
1416 IPC_SYNC_MESSAGE_CONTROL1_3(ViewHostMsg_CreateWindow, 1429 IPC_SYNC_MESSAGE_CONTROL1_3(ViewHostMsg_CreateWindow,
1417 ViewHostMsg_CreateWindow_Params, 1430 ViewHostMsg_CreateWindow_Params,
1418 int /* route_id */, 1431 int /* route_id */,
1419 int32 /* surface_id */, 1432 int32 /* surface_id */,
(...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after
1958 IPC_SYNC_MESSAGE_ROUTED1_0(ViewHostMsg_CreatePluginContainer, 1971 IPC_SYNC_MESSAGE_ROUTED1_0(ViewHostMsg_CreatePluginContainer,
1959 gfx::PluginWindowHandle /* id */) 1972 gfx::PluginWindowHandle /* id */)
1960 1973
1961 // Destroy a plugin container previously created using CreatePluginContainer. 1974 // Destroy a plugin container previously created using CreatePluginContainer.
1962 // id is the XID of the plugin window corresponding to the container that is 1975 // id is the XID of the plugin window corresponding to the container that is
1963 // to be destroyed. 1976 // to be destroyed.
1964 IPC_SYNC_MESSAGE_ROUTED1_0(ViewHostMsg_DestroyPluginContainer, 1977 IPC_SYNC_MESSAGE_ROUTED1_0(ViewHostMsg_DestroyPluginContainer,
1965 gfx::PluginWindowHandle /* id */) 1978 gfx::PluginWindowHandle /* id */)
1966 #endif 1979 #endif
1967 1980
1968 #if defined(OS_MACOSX)
1969 // Request that the browser load a font into shared memory for us.
1970 IPC_SYNC_MESSAGE_CONTROL1_3(ViewHostMsg_LoadFont,
1971 FontDescriptor /* font to load */,
1972 uint32 /* buffer size */,
1973 base::SharedMemoryHandle /* font data */,
1974 uint32 /* font id */)
1975 #endif
1976
1977 // Send the tooltip text for the current mouse position to the browser. 1981 // Send the tooltip text for the current mouse position to the browser.
1978 IPC_MESSAGE_ROUTED2(ViewHostMsg_SetTooltipText, 1982 IPC_MESSAGE_ROUTED2(ViewHostMsg_SetTooltipText,
1979 string16 /* tooltip text string */, 1983 string16 /* tooltip text string */,
1980 WebKit::WebTextDirection /* text direction hint */) 1984 WebKit::WebTextDirection /* text direction hint */)
1981 1985
1982 IPC_MESSAGE_ROUTED0(ViewHostMsg_SelectRange_ACK) 1986 IPC_MESSAGE_ROUTED0(ViewHostMsg_SelectRange_ACK)
1983 1987
1984 // Notification that the text selection has changed. 1988 // Notification that the text selection has changed.
1985 // Note: The secound parameter is the character based offset of the string16 1989 // Note: The secound parameter is the character based offset of the string16
1986 // text in the document. 1990 // text in the document.
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
2098 int /* minimum_percent */, 2102 int /* minimum_percent */,
2099 int /* maximum_percent */, 2103 int /* maximum_percent */,
2100 bool /* remember */) 2104 bool /* remember */)
2101 2105
2102 // Notify the browser that this render process can or can't be suddenly 2106 // Notify the browser that this render process can or can't be suddenly
2103 // terminated. 2107 // terminated.
2104 IPC_MESSAGE_CONTROL1(ViewHostMsg_SuddenTerminationChanged, 2108 IPC_MESSAGE_CONTROL1(ViewHostMsg_SuddenTerminationChanged,
2105 bool /* enabled */) 2109 bool /* enabled */)
2106 2110
2107 #if defined(OS_MACOSX) 2111 #if defined(OS_MACOSX)
2112 // Request that the browser load a font into shared memory for us.
2113 IPC_SYNC_MESSAGE_CONTROL1_3(ViewHostMsg_LoadFont,
2114 FontDescriptor /* font to load */,
2115 uint32 /* buffer size */,
2116 base::SharedMemoryHandle /* font data */,
2117 uint32 /* font id */)
2118
2108 // On OSX, we cannot allocated shared memory from within the sandbox, so 2119 // On OSX, we cannot allocated shared memory from within the sandbox, so
2109 // this call exists for the renderer to ask the browser to allocate memory 2120 // this call exists for the renderer to ask the browser to allocate memory
2110 // on its behalf. We return a file descriptor to the POSIX shared memory. 2121 // on its behalf. We return a file descriptor to the POSIX shared memory.
2111 // If the |cache_in_browser| flag is |true|, then a copy of the shmem is kept 2122 // If the |cache_in_browser| flag is |true|, then a copy of the shmem is kept
2112 // by the browser, and it is the caller's repsonsibility to send a 2123 // by the browser, and it is the caller's repsonsibility to send a
2113 // ViewHostMsg_FreeTransportDIB message in order to release the cached shmem. 2124 // ViewHostMsg_FreeTransportDIB message in order to release the cached shmem.
2114 // In all cases, the caller is responsible for deleting the resulting 2125 // In all cases, the caller is responsible for deleting the resulting
2115 // TransportDIB. 2126 // TransportDIB.
2116 IPC_SYNC_MESSAGE_CONTROL2_1(ViewHostMsg_AllocTransportDIB, 2127 IPC_SYNC_MESSAGE_CONTROL2_1(ViewHostMsg_AllocTransportDIB,
2117 size_t, /* bytes requested */ 2128 size_t, /* bytes requested */
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
2266 IPC_MESSAGE_ROUTED3(ViewHostMsg_SendCurrentPageAllSavableResourceLinks, 2277 IPC_MESSAGE_ROUTED3(ViewHostMsg_SendCurrentPageAllSavableResourceLinks,
2267 std::vector<GURL> /* all savable resource links */, 2278 std::vector<GURL> /* all savable resource links */,
2268 std::vector<content::Referrer> /* all referrers */, 2279 std::vector<content::Referrer> /* all referrers */,
2269 std::vector<GURL> /* all frame links */) 2280 std::vector<GURL> /* all frame links */)
2270 2281
2271 IPC_MESSAGE_ROUTED3(ViewHostMsg_SendSerializedHtmlData, 2282 IPC_MESSAGE_ROUTED3(ViewHostMsg_SendSerializedHtmlData,
2272 GURL /* frame's url */, 2283 GURL /* frame's url */,
2273 std::string /* data buffer */, 2284 std::string /* data buffer */,
2274 int32 /* complete status */) 2285 int32 /* complete status */)
2275 2286
2276 #if defined(OS_ANDROID)
2277 // Start an android intent with the given URI.
2278 IPC_MESSAGE_ROUTED1(ViewHostMsg_StartContentIntent,
2279 GURL /* content_url */)
2280 #endif
2281
2282 // Notifies the browser of an event occurring in the media pipeline. 2287 // Notifies the browser of an event occurring in the media pipeline.
2283 IPC_MESSAGE_CONTROL1(ViewHostMsg_MediaLogEvent, 2288 IPC_MESSAGE_CONTROL1(ViewHostMsg_MediaLogEvent,
2284 media::MediaLogEvent /* event */) 2289 media::MediaLogEvent /* event */)
2285 2290
2286 // Requests to lock the mouse. Will result in a ViewMsg_LockMouse_ACK message 2291 // Requests to lock the mouse. Will result in a ViewMsg_LockMouse_ACK message
2287 // being sent back. 2292 // being sent back.
2288 // |privileged| is used by Pepper Flash. If this flag is set to true, we won't 2293 // |privileged| is used by Pepper Flash. If this flag is set to true, we won't
2289 // pop up a bubble to ask for user permission or take mouse lock content into 2294 // pop up a bubble to ask for user permission or take mouse lock content into
2290 // account. 2295 // account.
2291 IPC_MESSAGE_ROUTED3(ViewHostMsg_LockMouse, 2296 IPC_MESSAGE_ROUTED3(ViewHostMsg_LockMouse,
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
2364 // your locally cached rects should still be valid). The rect coords will be 2369 // your locally cached rects should still be valid). The rect coords will be
2365 // custom normalized fractions of the document size. The rects will be sorted by 2370 // custom normalized fractions of the document size. The rects will be sorted by
2366 // frame traversal order starting in the main frame, then by dom order. 2371 // frame traversal order starting in the main frame, then by dom order.
2367 // 2372 //
2368 // |active_rect| will contain the bounding box of the active find-in-page match 2373 // |active_rect| will contain the bounding box of the active find-in-page match
2369 // marker, in similarly normalized coords (or an empty rect if there isn't one). 2374 // marker, in similarly normalized coords (or an empty rect if there isn't one).
2370 IPC_MESSAGE_ROUTED3(ViewHostMsg_FindMatchRects_Reply, 2375 IPC_MESSAGE_ROUTED3(ViewHostMsg_FindMatchRects_Reply,
2371 int /* version */, 2376 int /* version */,
2372 std::vector<gfx::RectF> /* rects */, 2377 std::vector<gfx::RectF> /* rects */,
2373 gfx::RectF /* active_rect */) 2378 gfx::RectF /* active_rect */)
2379
2380 // Start an android intent with the given URI.
2381 IPC_MESSAGE_ROUTED1(ViewHostMsg_StartContentIntent,
2382 GURL /* content_url */)
2374 #endif 2383 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698