Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/shared_memory.h" | 10 #include "base/shared_memory.h" |
| 11 #include "content/public/common/common_param_traits.h" | 11 #include "content/public/common/common_param_traits.h" |
| 12 #include "ipc/ipc_message_macros.h" | 12 #include "ipc/ipc_message_macros.h" |
| 13 #include "ipc/ipc_param_traits.h" | 13 #include "ipc/ipc_param_traits.h" |
| 14 #include "ui/base/clipboard/clipboard.h" | 14 #include "ui/base/clipboard/clipboard.h" |
| 15 | 15 |
| 16 #define IPC_MESSAGE_START ClipboardMsgStart | 16 #define IPC_MESSAGE_START ClipboardMsgStart |
| 17 | 17 |
| 18 #ifndef CONTENT_COMMON_CLIPBOARD_MESSAGES_H_ | |
| 19 #define CONTENT_COMMON_CLIPBOARD_MESSAGES_H_ | |
|
tony
2011/12/06 23:57:20
I don't understand this, so I'll let John review i
dcheng
2011/12/07 00:09:02
This file normally gets included multiple times to
| |
| 20 | |
| 21 namespace IPC { | |
| 22 | |
| 23 template<> | |
| 24 struct ParamTraits<ui::Clipboard::FormatType> { | |
| 25 typedef ui::Clipboard::FormatType param_type; | |
| 26 static void Write(Message* m, const param_type& p); | |
| 27 static bool Read(const Message* m, void** iter, param_type* r); | |
| 28 static void Log(const param_type& p, std::string* l); | |
| 29 }; | |
| 30 | |
| 31 } // namespace IPC | |
| 32 | |
| 33 #endif // CONTENT_COMMON_CLIPBOARD_MESSAGES_H_ | |
| 34 | |
| 18 IPC_ENUM_TRAITS(ui::Clipboard::Buffer) | 35 IPC_ENUM_TRAITS(ui::Clipboard::Buffer) |
| 19 | 36 |
| 20 // Clipboard IPC messages sent from the renderer to the browser. | 37 // Clipboard IPC messages sent from the renderer to the browser. |
| 21 | 38 |
| 22 // This message is used when the object list does not contain a bitmap. | 39 // This message is used when the object list does not contain a bitmap. |
| 23 IPC_MESSAGE_CONTROL1(ClipboardHostMsg_WriteObjectsAsync, | 40 IPC_MESSAGE_CONTROL1(ClipboardHostMsg_WriteObjectsAsync, |
| 24 ui::Clipboard::ObjectMap /* objects */) | 41 ui::Clipboard::ObjectMap /* objects */) |
| 25 // This message is used when the object list contains a bitmap. | 42 // This message is used when the object list contains a bitmap. |
| 26 // It is synchronized so that the renderer knows when it is safe to | 43 // It is synchronized so that the renderer knows when it is safe to |
| 27 // free the shared memory used to transfer the bitmap. | 44 // free the shared memory used to transfer the bitmap. |
| 28 IPC_SYNC_MESSAGE_CONTROL2_0(ClipboardHostMsg_WriteObjectsSync, | 45 IPC_SYNC_MESSAGE_CONTROL2_0(ClipboardHostMsg_WriteObjectsSync, |
| 29 ui::Clipboard::ObjectMap /* objects */, | 46 ui::Clipboard::ObjectMap /* objects */, |
| 30 base::SharedMemoryHandle /* bitmap handle */) | 47 base::SharedMemoryHandle /* bitmap handle */) |
| 31 IPC_SYNC_MESSAGE_CONTROL1_1(ClipboardHostMsg_GetSequenceNumber, | 48 IPC_SYNC_MESSAGE_CONTROL1_1(ClipboardHostMsg_GetSequenceNumber, |
| 32 ui::Clipboard::Buffer /* buffer */, | 49 ui::Clipboard::Buffer /* buffer */, |
| 33 uint64 /* result */) | 50 uint64 /* result */) |
| 34 IPC_SYNC_MESSAGE_CONTROL2_1(ClipboardHostMsg_IsFormatAvailable, | 51 IPC_SYNC_MESSAGE_CONTROL2_1(ClipboardHostMsg_IsFormatAvailable, |
| 35 std::string /* format */, | 52 ui::Clipboard::FormatType /* format */, |
| 36 ui::Clipboard::Buffer /* buffer */, | 53 ui::Clipboard::Buffer /* buffer */, |
| 37 bool /* result */) | 54 bool /* result */) |
| 38 IPC_SYNC_MESSAGE_CONTROL1_2(ClipboardHostMsg_ReadAvailableTypes, | 55 IPC_SYNC_MESSAGE_CONTROL1_2(ClipboardHostMsg_ReadAvailableTypes, |
| 39 ui::Clipboard::Buffer /* buffer */, | 56 ui::Clipboard::Buffer /* buffer */, |
| 40 std::vector<string16> /* types */, | 57 std::vector<string16> /* types */, |
| 41 bool /* contains filenames */) | 58 bool /* contains filenames */) |
| 42 IPC_SYNC_MESSAGE_CONTROL1_1(ClipboardHostMsg_ReadText, | 59 IPC_SYNC_MESSAGE_CONTROL1_1(ClipboardHostMsg_ReadText, |
| 43 ui::Clipboard::Buffer /* buffer */, | 60 ui::Clipboard::Buffer /* buffer */, |
| 44 string16 /* result */) | 61 string16 /* result */) |
| 45 IPC_SYNC_MESSAGE_CONTROL1_1(ClipboardHostMsg_ReadAsciiText, | 62 IPC_SYNC_MESSAGE_CONTROL1_1(ClipboardHostMsg_ReadAsciiText, |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 57 uint32 /* image size */) | 74 uint32 /* image size */) |
| 58 IPC_SYNC_MESSAGE_CONTROL2_1(ClipboardHostMsg_ReadCustomData, | 75 IPC_SYNC_MESSAGE_CONTROL2_1(ClipboardHostMsg_ReadCustomData, |
| 59 ui::Clipboard::Buffer /* buffer */, | 76 ui::Clipboard::Buffer /* buffer */, |
| 60 string16 /* type */, | 77 string16 /* type */, |
| 61 string16 /* result */) | 78 string16 /* result */) |
| 62 | 79 |
| 63 #if defined(OS_MACOSX) | 80 #if defined(OS_MACOSX) |
| 64 IPC_MESSAGE_CONTROL1(ClipboardHostMsg_FindPboardWriteStringAsync, | 81 IPC_MESSAGE_CONTROL1(ClipboardHostMsg_FindPboardWriteStringAsync, |
| 65 string16 /* text */) | 82 string16 /* text */) |
| 66 #endif | 83 #endif |
| OLD | NEW |