OLD | NEW |
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 drag and drop. | 5 // IPC messages for drag and drop. |
6 // Multiply-included message file, hence no include guard. | 6 // Multiply-included message file, hence no include guard. |
7 | 7 |
8 #include "content/common/drag_event_source_info.h" | 8 #include "content/common/drag_event_source_info.h" |
9 #include "content/public/common/common_param_traits.h" | 9 #include "content/public/common/common_param_traits.h" |
10 #include "content/public/common/drop_data.h" | 10 #include "content/public/common/drop_data.h" |
11 #include "ipc/ipc_message_macros.h" | 11 #include "ipc/ipc_message_macros.h" |
12 #include "third_party/skia/include/core/SkBitmap.h" | 12 #include "third_party/skia/include/core/SkBitmap.h" |
13 #include "third_party/WebKit/public/web/WebDragOperation.h" | 13 #include "third_party/WebKit/public/web/WebDragOperation.h" |
14 #include "ui/gfx/point.h" | 14 #include "ui/gfx/point.h" |
15 #include "ui/gfx/vector2d.h" | 15 #include "ui/gfx/vector2d.h" |
16 | 16 |
17 #define IPC_MESSAGE_START DragMsgStart | 17 #define IPC_MESSAGE_START DragMsgStart |
18 | 18 |
19 // Messages sent from the browser to the renderer. | 19 // Messages sent from the browser to the renderer. |
20 | 20 |
21 IPC_MESSAGE_ROUTED5(DragMsg_TargetDragEnter, | 21 IPC_MESSAGE_ROUTED5(DragMsg_TargetDragEnter, |
22 content::DropData /* drop_data */, | 22 content::DropData /* drop_data */, |
23 gfx::Point /* client_pt */, | 23 gfx::Point /* client_pt */, |
24 gfx::Point /* screen_pt */, | 24 gfx::Point /* screen_pt */, |
25 WebKit::WebDragOperationsMask /* ops_allowed */, | 25 blink::WebDragOperationsMask /* ops_allowed */, |
26 int /* key_modifiers */) | 26 int /* key_modifiers */) |
27 | 27 |
28 IPC_MESSAGE_ROUTED4(DragMsg_TargetDragOver, | 28 IPC_MESSAGE_ROUTED4(DragMsg_TargetDragOver, |
29 gfx::Point /* client_pt */, | 29 gfx::Point /* client_pt */, |
30 gfx::Point /* screen_pt */, | 30 gfx::Point /* screen_pt */, |
31 WebKit::WebDragOperationsMask /* ops_allowed */, | 31 blink::WebDragOperationsMask /* ops_allowed */, |
32 int /* key_modifiers */) | 32 int /* key_modifiers */) |
33 | 33 |
34 IPC_MESSAGE_ROUTED0(DragMsg_TargetDragLeave) | 34 IPC_MESSAGE_ROUTED0(DragMsg_TargetDragLeave) |
35 | 35 |
36 IPC_MESSAGE_ROUTED3(DragMsg_TargetDrop, | 36 IPC_MESSAGE_ROUTED3(DragMsg_TargetDrop, |
37 gfx::Point /* client_pt */, | 37 gfx::Point /* client_pt */, |
38 gfx::Point /* screen_pt */, | 38 gfx::Point /* screen_pt */, |
39 int /* key_modifiers */) | 39 int /* key_modifiers */) |
40 | 40 |
41 // Notifies the renderer of updates in mouse position of an in-progress | 41 // Notifies the renderer of updates in mouse position of an in-progress |
42 // drag. if |ended| is true, then the user has ended the drag operation. | 42 // drag. if |ended| is true, then the user has ended the drag operation. |
43 IPC_MESSAGE_ROUTED4(DragMsg_SourceEndedOrMoved, | 43 IPC_MESSAGE_ROUTED4(DragMsg_SourceEndedOrMoved, |
44 gfx::Point /* client_pt */, | 44 gfx::Point /* client_pt */, |
45 gfx::Point /* screen_pt */, | 45 gfx::Point /* screen_pt */, |
46 bool /* ended */, | 46 bool /* ended */, |
47 WebKit::WebDragOperation /* drag_operation */) | 47 blink::WebDragOperation /* drag_operation */) |
48 | 48 |
49 // Notifies the renderer that the system DoDragDrop call has ended. | 49 // Notifies the renderer that the system DoDragDrop call has ended. |
50 IPC_MESSAGE_ROUTED0(DragMsg_SourceSystemDragEnded) | 50 IPC_MESSAGE_ROUTED0(DragMsg_SourceSystemDragEnded) |
51 | 51 |
52 // Messages sent from the renderer to the browser. | 52 // Messages sent from the renderer to the browser. |
53 | 53 |
54 // Used to tell the parent the user started dragging in the content area. The | 54 // Used to tell the parent the user started dragging in the content area. The |
55 // DropData struct contains contextual information about the pieces of the | 55 // DropData struct contains contextual information about the pieces of the |
56 // page the user dragged. The parent uses this notification to initiate a | 56 // page the user dragged. The parent uses this notification to initiate a |
57 // drag session at the OS level. | 57 // drag session at the OS level. |
58 IPC_MESSAGE_ROUTED5(DragHostMsg_StartDragging, | 58 IPC_MESSAGE_ROUTED5(DragHostMsg_StartDragging, |
59 content::DropData /* drop_data */, | 59 content::DropData /* drop_data */, |
60 WebKit::WebDragOperationsMask /* ops_allowed */, | 60 blink::WebDragOperationsMask /* ops_allowed */, |
61 SkBitmap /* image */, | 61 SkBitmap /* image */, |
62 gfx::Vector2d /* image_offset */, | 62 gfx::Vector2d /* image_offset */, |
63 content::DragEventSourceInfo /* event_info */) | 63 content::DragEventSourceInfo /* event_info */) |
64 | 64 |
65 // The page wants to update the mouse cursor during a drag & drop operation. | 65 // The page wants to update the mouse cursor during a drag & drop operation. |
66 // |is_drop_target| is true if the mouse is over a valid drop target. | 66 // |is_drop_target| is true if the mouse is over a valid drop target. |
67 IPC_MESSAGE_ROUTED1(DragHostMsg_UpdateDragCursor, | 67 IPC_MESSAGE_ROUTED1(DragHostMsg_UpdateDragCursor, |
68 WebKit::WebDragOperation /* drag_operation */) | 68 blink::WebDragOperation /* drag_operation */) |
69 | 69 |
70 // Notifies the host that the renderer finished a drop operation. | 70 // Notifies the host that the renderer finished a drop operation. |
71 IPC_MESSAGE_ROUTED0(DragHostMsg_TargetDrop_ACK) | 71 IPC_MESSAGE_ROUTED0(DragHostMsg_TargetDrop_ACK) |
OLD | NEW |