| 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 // Multiply-included message file, so no include guard. | 5 // Multiply-included message file, so no include guard. |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/memory/shared_memory.h" | 11 #include "base/memory/shared_memory.h" |
| 12 #include "base/strings/string16.h" | 12 #include "base/strings/string16.h" |
| 13 #include "content/common/clipboard_format.h" | 13 #include "content/common/clipboard_format.h" |
| 14 #include "content/public/common/common_param_traits.h" | 14 #include "content/public/common/common_param_traits.h" |
| 15 #include "ipc/ipc_message_macros.h" | 15 #include "ipc/ipc_message_macros.h" |
| 16 #include "ui/base/clipboard/clipboard.h" | 16 #include "ui/base/clipboard/clipboard.h" |
| 17 | 17 |
| 18 // Singly-included section for types and/or struct declarations. |
| 19 #ifndef CONTENT_COMMON_CLIPBOARD_MESSAGES_H_ |
| 20 #define CONTENT_COMMON_CLIPBOARD_MESSAGES_H_ |
| 21 |
| 22 // Custom data consists of arbitrary MIME types an untrusted sender wants to |
| 23 // write to the clipboard. Note that exposing a general interface to do this is |
| 24 // dangerous--an untrusted sender could cause a DoS or code execution. |
| 25 typedef std::map<base::string16, base::string16> CustomDataMap; |
| 26 |
| 27 #endif // CONTENT_COMMON_CLIPBOARD_MESSAGES_H_ |
| 28 |
| 18 #define IPC_MESSAGE_START ClipboardMsgStart | 29 #define IPC_MESSAGE_START ClipboardMsgStart |
| 19 | 30 |
| 20 IPC_ENUM_TRAITS_MAX_VALUE(content::ClipboardFormat, | 31 IPC_ENUM_TRAITS_MAX_VALUE(content::ClipboardFormat, |
| 21 content::CLIPBOARD_FORMAT_LAST) | 32 content::CLIPBOARD_FORMAT_LAST) |
| 22 IPC_ENUM_TRAITS_MAX_VALUE(ui::ClipboardType, ui::CLIPBOARD_TYPE_LAST) | 33 IPC_ENUM_TRAITS_MAX_VALUE(ui::ClipboardType, ui::CLIPBOARD_TYPE_LAST) |
| 23 | 34 |
| 24 // Clipboard IPC messages sent from the renderer to the browser. | 35 // Clipboard IPC messages sent from the renderer to the browser. |
| 25 | 36 |
| 26 IPC_SYNC_MESSAGE_CONTROL1_1(ClipboardHostMsg_GetSequenceNumber, | 37 IPC_SYNC_MESSAGE_CONTROL1_1(ClipboardHostMsg_GetSequenceNumber, |
| 27 ui::ClipboardType /* type */, | 38 ui::ClipboardType /* type */, |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 // sends the different types of data it'd like to write to the receiver. Then, | 72 // sends the different types of data it'd like to write to the receiver. Then, |
| 62 // it sends a commit message to commit the data to the system clipboard. | 73 // it sends a commit message to commit the data to the system clipboard. |
| 63 IPC_MESSAGE_CONTROL2(ClipboardHostMsg_WriteText, | 74 IPC_MESSAGE_CONTROL2(ClipboardHostMsg_WriteText, |
| 64 ui::ClipboardType /* type */, | 75 ui::ClipboardType /* type */, |
| 65 base::string16 /* text */) | 76 base::string16 /* text */) |
| 66 IPC_MESSAGE_CONTROL3(ClipboardHostMsg_WriteHTML, | 77 IPC_MESSAGE_CONTROL3(ClipboardHostMsg_WriteHTML, |
| 67 ui::ClipboardType /* type */, | 78 ui::ClipboardType /* type */, |
| 68 base::string16 /* markup */, | 79 base::string16 /* markup */, |
| 69 GURL /* url */) | 80 GURL /* url */) |
| 70 IPC_MESSAGE_CONTROL1(ClipboardHostMsg_WriteSmartPasteMarker, | 81 IPC_MESSAGE_CONTROL1(ClipboardHostMsg_WriteSmartPasteMarker, |
| 71 ui::ClipboardType /* type */); | 82 ui::ClipboardType /* type */) |
| 72 // Custom data consists of arbitrary MIME types an untrusted sender wants to | |
| 73 // write to the clipboard. Note that exposing a general interface to do this is | |
| 74 // dangerous--an untrusted sender could cause a DoS or code execution. | |
| 75 typedef std::map<base::string16, base::string16> CustomDataMap; | |
| 76 IPC_MESSAGE_CONTROL2(ClipboardHostMsg_WriteCustomData, | 83 IPC_MESSAGE_CONTROL2(ClipboardHostMsg_WriteCustomData, |
| 77 ui::ClipboardType /* type */, | 84 ui::ClipboardType /* type */, |
| 78 CustomDataMap /* custom data */) | 85 CustomDataMap /* custom data */) |
| 79 IPC_MESSAGE_CONTROL3(ClipboardHostMsg_WriteBookmark, | 86 IPC_MESSAGE_CONTROL3(ClipboardHostMsg_WriteBookmark, |
| 80 ui::ClipboardType /* type */, | 87 ui::ClipboardType /* type */, |
| 81 GURL /* url */, | 88 GURL /* url */, |
| 82 base::string16 /* title */) | 89 base::string16 /* title */) |
| 83 IPC_SYNC_MESSAGE_CONTROL3_0(ClipboardHostMsg_WriteImage, | 90 IPC_SYNC_MESSAGE_CONTROL3_0(ClipboardHostMsg_WriteImage, |
| 84 ui::ClipboardType /* type */, | 91 ui::ClipboardType /* type */, |
| 85 gfx::Size /* size */, | 92 gfx::Size /* size */, |
| 86 base::SharedMemoryHandle /* bitmap handle */) | 93 base::SharedMemoryHandle /* bitmap handle */) |
| 87 IPC_MESSAGE_CONTROL1(ClipboardHostMsg_CommitWrite, ui::ClipboardType /* type */) | 94 IPC_MESSAGE_CONTROL1(ClipboardHostMsg_CommitWrite, ui::ClipboardType /* type */) |
| 88 | 95 |
| 89 #if defined(OS_MACOSX) | 96 #if defined(OS_MACOSX) |
| 90 IPC_MESSAGE_CONTROL1(ClipboardHostMsg_FindPboardWriteStringAsync, | 97 IPC_MESSAGE_CONTROL1(ClipboardHostMsg_FindPboardWriteStringAsync, |
| 91 base::string16 /* text */) | 98 base::string16 /* text */) |
| 92 #endif | 99 #endif |
| OLD | NEW |