api_messages.h 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. // Copyright (c) 2013 GitHub, Inc.
  2. // Use of this source code is governed by the MIT license that can be
  3. // found in the LICENSE file.
  4. // Multiply-included file, no traditional include guard.
  5. #include "atom/common/draggable_region.h"
  6. #include "base/strings/string16.h"
  7. #include "base/values.h"
  8. #include "content/public/common/common_param_traits.h"
  9. #include "content/public/common/referrer.h"
  10. #include "ipc/ipc_message_macros.h"
  11. #include "ipc/ipc_platform_file.h"
  12. #include "ui/gfx/geometry/rect_f.h"
  13. #include "ui/gfx/ipc/gfx_param_traits.h"
  14. #include "url/gurl.h"
  15. // The message starter should be declared in ipc/ipc_message_start.h. Since
  16. // we don't want to patch Chromium, we just pretend to be Content Shell.
  17. #define IPC_MESSAGE_START ShellMsgStart
  18. IPC_STRUCT_TRAITS_BEGIN(atom::DraggableRegion)
  19. IPC_STRUCT_TRAITS_MEMBER(draggable)
  20. IPC_STRUCT_TRAITS_MEMBER(bounds)
  21. IPC_STRUCT_TRAITS_END()
  22. IPC_MESSAGE_ROUTED2(AtomFrameHostMsg_Message,
  23. std::string /* channel */,
  24. base::ListValue /* arguments */)
  25. IPC_SYNC_MESSAGE_ROUTED2_1(AtomFrameHostMsg_Message_Sync,
  26. std::string /* channel */,
  27. base::ListValue /* arguments */,
  28. base::ListValue /* result */)
  29. IPC_MESSAGE_ROUTED5(AtomFrameHostMsg_Message_To,
  30. bool /* internal */,
  31. bool /* send_to_all */,
  32. int32_t /* web_contents_id */,
  33. std::string /* channel */,
  34. base::ListValue /* arguments */)
  35. IPC_MESSAGE_ROUTED5(AtomFrameMsg_Message,
  36. bool /* internal */,
  37. bool /* send_to_all */,
  38. std::string /* channel */,
  39. base::ListValue /* arguments */,
  40. int32_t /* sender_id */)
  41. IPC_MESSAGE_ROUTED0(AtomViewMsg_Offscreen)
  42. IPC_MESSAGE_ROUTED3(AtomAutofillFrameHostMsg_ShowPopup,
  43. gfx::RectF /* bounds */,
  44. std::vector<base::string16> /* values */,
  45. std::vector<base::string16> /* labels */)
  46. IPC_MESSAGE_ROUTED0(AtomAutofillFrameHostMsg_HidePopup)
  47. IPC_MESSAGE_ROUTED1(AtomAutofillFrameMsg_AcceptSuggestion,
  48. base::string16 /* suggestion */)
  49. // Sent by the renderer when the draggable regions are updated.
  50. IPC_MESSAGE_ROUTED1(AtomFrameHostMsg_UpdateDraggableRegions,
  51. std::vector<atom::DraggableRegion> /* regions */)
  52. // Update renderer process preferences.
  53. IPC_MESSAGE_CONTROL1(AtomMsg_UpdatePreferences, base::ListValue)
  54. // Sent by renderer to set the temporary zoom level.
  55. IPC_SYNC_MESSAGE_ROUTED1_1(AtomFrameHostMsg_SetTemporaryZoomLevel,
  56. double /* zoom level */,
  57. double /* result */)
  58. // Sent by renderer to get the zoom level.
  59. IPC_SYNC_MESSAGE_ROUTED0_1(AtomFrameHostMsg_GetZoomLevel, double /* result */)
  60. // Brings up SaveAs... dialog to save specified URL.
  61. IPC_MESSAGE_ROUTED2(AtomFrameHostMsg_PDFSaveURLAs,
  62. GURL /* url */,
  63. content::Referrer /* referrer */)
  64. IPC_MESSAGE_ROUTED2(AtomFrameMsg_TakeHeapSnapshot,
  65. IPC::PlatformFileForTransit /* file_handle */,
  66. std::string /* channel */)