| 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 <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/memory/shared_memory.h" | 10 #include "base/memory/shared_memory.h" |
| 11 #include "content/common/clipboard_message_enums.h" |
| 11 #include "content/public/common/common_param_traits.h" | 12 #include "content/public/common/common_param_traits.h" |
| 12 #include "ipc/ipc_message_macros.h" | 13 #include "ipc/ipc_message_macros.h" |
| 13 #include "ipc/ipc_param_traits.h" | 14 #include "ipc/ipc_param_traits.h" |
| 14 #include "ui/base/clipboard/clipboard.h" | 15 #include "ui/base/clipboard/clipboard.h" |
| 15 | 16 |
| 16 #define IPC_MESSAGE_START ClipboardMsgStart | 17 #define IPC_MESSAGE_START ClipboardMsgStart |
| 17 | 18 |
| 18 #ifndef CONTENT_COMMON_CLIPBOARD_MESSAGES_H_ | 19 #ifndef CONTENT_COMMON_CLIPBOARD_MESSAGES_H_ |
| 19 #define CONTENT_COMMON_CLIPBOARD_MESSAGES_H_ | 20 #define CONTENT_COMMON_CLIPBOARD_MESSAGES_H_ |
| 20 | 21 |
| 21 namespace IPC { | 22 namespace IPC { |
| 22 | 23 |
| 23 template<> | 24 template<> |
| 24 struct ParamTraits<ui::Clipboard::FormatType> { | 25 struct ParamTraits<ui::Clipboard::FormatType> { |
| 25 typedef ui::Clipboard::FormatType param_type; | 26 typedef ui::Clipboard::FormatType param_type; |
| 26 static void Write(Message* m, const param_type& p); | 27 static void Write(Message* m, const param_type& p); |
| 27 static bool Read(const Message* m, PickleIterator* iter, param_type* r); | 28 static bool Read(const Message* m, PickleIterator* iter, param_type* r); |
| 28 static void Log(const param_type& p, std::string* l); | 29 static void Log(const param_type& p, std::string* l); |
| 29 }; | 30 }; |
| 30 | 31 |
| 31 } // namespace IPC | 32 } // namespace IPC |
| 32 | 33 |
| 33 #endif // CONTENT_COMMON_CLIPBOARD_MESSAGES_H_ | 34 #endif // CONTENT_COMMON_CLIPBOARD_MESSAGES_H_ |
| 34 | 35 |
| 36 IPC_ENUM_TRAITS_MAX_VALUE(content::ClipboardFormat, |
| 37 content::kClipboardFormatLast) |
| 35 IPC_ENUM_TRAITS_MAX_VALUE(ui::ClipboardType, ui::CLIPBOARD_TYPE_LAST) | 38 IPC_ENUM_TRAITS_MAX_VALUE(ui::ClipboardType, ui::CLIPBOARD_TYPE_LAST) |
| 36 | 39 |
| 37 // Clipboard IPC messages sent from the renderer to the browser. | 40 // Clipboard IPC messages sent from the renderer to the browser. |
| 38 | 41 |
| 39 // This message is used when the object list does not contain a bitmap. | 42 // This message is used when the object list does not contain a bitmap. |
| 40 IPC_MESSAGE_CONTROL1(ClipboardHostMsg_WriteObjectsAsync, | 43 IPC_MESSAGE_CONTROL1(ClipboardHostMsg_WriteObjectsAsync, |
| 41 ui::Clipboard::ObjectMap /* objects */) | 44 ui::Clipboard::ObjectMap /* objects */) |
| 42 // This message is used when the object list contains a bitmap. | 45 // This message is used when the object list contains a bitmap. |
| 43 // It is synchronized so that the renderer knows when it is safe to | 46 // It is synchronized so that the renderer knows when it is safe to |
| 44 // free the shared memory used to transfer the bitmap. | 47 // free the shared memory used to transfer the bitmap. |
| 45 IPC_SYNC_MESSAGE_CONTROL2_0(ClipboardHostMsg_WriteObjectsSync, | 48 IPC_SYNC_MESSAGE_CONTROL2_0(ClipboardHostMsg_WriteObjectsSync, |
| 46 ui::Clipboard::ObjectMap /* objects */, | 49 ui::Clipboard::ObjectMap /* objects */, |
| 47 base::SharedMemoryHandle /* bitmap handle */) | 50 base::SharedMemoryHandle /* bitmap handle */) |
| 48 IPC_SYNC_MESSAGE_CONTROL1_1(ClipboardHostMsg_GetSequenceNumber, | 51 IPC_SYNC_MESSAGE_CONTROL1_1(ClipboardHostMsg_GetSequenceNumber, |
| 49 ui::ClipboardType /* type */, | 52 ui::ClipboardType /* type */, |
| 50 uint64 /* result */) | 53 uint64 /* result */) |
| 51 IPC_SYNC_MESSAGE_CONTROL2_1(ClipboardHostMsg_IsFormatAvailable, | 54 IPC_SYNC_MESSAGE_CONTROL2_1(ClipboardHostMsg_IsFormatAvailable, |
| 52 ui::Clipboard::FormatType /* format */, | 55 content::ClipboardFormat /* format */, |
| 53 ui::ClipboardType /* type */, | 56 ui::ClipboardType /* type */, |
| 54 bool /* result */) | 57 bool /* result */) |
| 55 IPC_MESSAGE_CONTROL1(ClipboardHostMsg_Clear, | 58 IPC_MESSAGE_CONTROL1(ClipboardHostMsg_Clear, |
| 56 ui::ClipboardType /* type */) | 59 ui::ClipboardType /* type */) |
| 57 IPC_SYNC_MESSAGE_CONTROL1_2(ClipboardHostMsg_ReadAvailableTypes, | 60 IPC_SYNC_MESSAGE_CONTROL1_2(ClipboardHostMsg_ReadAvailableTypes, |
| 58 ui::ClipboardType /* type */, | 61 ui::ClipboardType /* type */, |
| 59 std::vector<base::string16> /* types */, | 62 std::vector<base::string16> /* types */, |
| 60 bool /* contains filenames */) | 63 bool /* contains filenames */) |
| 61 IPC_SYNC_MESSAGE_CONTROL1_1(ClipboardHostMsg_ReadText, | 64 IPC_SYNC_MESSAGE_CONTROL1_1(ClipboardHostMsg_ReadText, |
| 62 ui::ClipboardType /* type */, | 65 ui::ClipboardType /* type */, |
| 63 base::string16 /* result */) | 66 base::string16 /* result */) |
| 64 IPC_SYNC_MESSAGE_CONTROL1_1(ClipboardHostMsg_ReadAsciiText, | |
| 65 ui::ClipboardType /* type */, | |
| 66 std::string /* result */) | |
| 67 IPC_SYNC_MESSAGE_CONTROL1_4(ClipboardHostMsg_ReadHTML, | 67 IPC_SYNC_MESSAGE_CONTROL1_4(ClipboardHostMsg_ReadHTML, |
| 68 ui::ClipboardType /* type */, | 68 ui::ClipboardType /* type */, |
| 69 base::string16 /* markup */, | 69 base::string16 /* markup */, |
| 70 GURL /* url */, | 70 GURL /* url */, |
| 71 uint32 /* fragment start */, | 71 uint32 /* fragment start */, |
| 72 uint32 /* fragment end */) | 72 uint32 /* fragment end */) |
| 73 IPC_SYNC_MESSAGE_CONTROL1_1(ClipboardHostMsg_ReadRTF, | 73 IPC_SYNC_MESSAGE_CONTROL1_1(ClipboardHostMsg_ReadRTF, |
| 74 ui::ClipboardType /* type */, | 74 ui::ClipboardType /* type */, |
| 75 std::string /* result */) | 75 std::string /* result */) |
| 76 IPC_SYNC_MESSAGE_CONTROL1_2(ClipboardHostMsg_ReadImage, | 76 IPC_SYNC_MESSAGE_CONTROL1_2(ClipboardHostMsg_ReadImage, |
| 77 ui::ClipboardType /* type */, | 77 ui::ClipboardType /* type */, |
| 78 base::SharedMemoryHandle /* PNG-encoded image */, | 78 base::SharedMemoryHandle /* PNG-encoded image */, |
| 79 uint32 /* image size */) | 79 uint32 /* image size */) |
| 80 IPC_SYNC_MESSAGE_CONTROL2_1(ClipboardHostMsg_ReadCustomData, | 80 IPC_SYNC_MESSAGE_CONTROL2_1(ClipboardHostMsg_ReadCustomData, |
| 81 ui::ClipboardType /* type */, | 81 ui::ClipboardType /* type */, |
| 82 base::string16 /* type */, | 82 base::string16 /* type */, |
| 83 base::string16 /* result */) | 83 base::string16 /* result */) |
| 84 IPC_SYNC_MESSAGE_CONTROL1_1(ClipboardHostMsg_ReadData, | 84 IPC_SYNC_MESSAGE_CONTROL1_1(ClipboardHostMsg_ReadData, |
| 85 ui::Clipboard::FormatType /* format */, | 85 ui::Clipboard::FormatType /* format */, |
| 86 std::string /* result */) | 86 std::string /* result */) |
| 87 | 87 |
| 88 #if defined(OS_MACOSX) | 88 #if defined(OS_MACOSX) |
| 89 IPC_MESSAGE_CONTROL1(ClipboardHostMsg_FindPboardWriteStringAsync, | 89 IPC_MESSAGE_CONTROL1(ClipboardHostMsg_FindPboardWriteStringAsync, |
| 90 base::string16 /* text */) | 90 base::string16 /* text */) |
| 91 #endif | 91 #endif |
| OLD | NEW |