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 #include "chrome/common/common_param_traits.h" | 5 #include "chrome/common/common_param_traits.h" |
6 #include "content/public/common/webkit_param_traits.h" | 6 #include "content/public/common/webkit_param_traits.h" |
7 #include "ui/base/models/menu_model.h" | 7 #include "ui/base/models/menu_model.h" |
8 | 8 |
9 // Get basic type definitions. | 9 // Get basic type definitions. |
10 #define IPC_MESSAGE_IMPL | 10 #define IPC_MESSAGE_IMPL |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 LogParam(item.enabled, l); | 128 LogParam(item.enabled, l); |
129 if (item.type == ui::MenuModel::TYPE_SUBMENU) { | 129 if (item.type == ui::MenuModel::TYPE_SUBMENU) { |
130 l->append(", "); | 130 l->append(", "); |
131 Log(*item.submenu, l); | 131 Log(*item.submenu, l); |
132 } | 132 } |
133 l->append(")"); | 133 l->append(")"); |
134 } | 134 } |
135 l->append(")"); | 135 l->append(")"); |
136 } | 136 } |
137 | 137 |
| 138 // static |
| 139 void ParamTraits<AutomationMouseEvent>::Write(Message* m, |
| 140 const param_type& p) { |
| 141 WriteParam(m, std::string(reinterpret_cast<const char*>(&p.mouse_event), |
| 142 sizeof(p.mouse_event))); |
| 143 WriteParam(m, p.location_script_chain); |
| 144 } |
| 145 |
| 146 // static |
| 147 bool ParamTraits<AutomationMouseEvent>::Read(const Message* m, |
| 148 PickleIterator* iter, |
| 149 param_type* p) { |
| 150 std::string mouse_event; |
| 151 if (!ReadParam(m, iter, &mouse_event)) |
| 152 return false; |
| 153 memcpy(&p->mouse_event, mouse_event.c_str(), mouse_event.length()); |
| 154 if (!ReadParam(m, iter, &p->location_script_chain)) |
| 155 return false; |
| 156 return true; |
| 157 } |
| 158 |
| 159 // static |
| 160 void ParamTraits<AutomationMouseEvent>::Log(const param_type& p, |
| 161 std::string* l) { |
| 162 l->append("("); |
| 163 LogParam(std::string(reinterpret_cast<const char*>(&p.mouse_event), |
| 164 sizeof(p.mouse_event)), |
| 165 l); |
| 166 l->append(", "); |
| 167 LogParam(p.location_script_chain, l); |
| 168 l->append(")"); |
| 169 } |
| 170 |
138 } // namespace IPC | 171 } // namespace IPC |
OLD | NEW |