OLD | NEW |
1 // Copyright (c) 2011 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 |
11 #include "chrome/common/automation_messages.h" | 11 #include "chrome/common/automation_messages.h" |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 WriteParam(m, p.items[i].enabled); | 66 WriteParam(m, p.items[i].enabled); |
67 | 67 |
68 if (p.items[i].type == static_cast<int>(ui::MenuModel::TYPE_SUBMENU)) { | 68 if (p.items[i].type == static_cast<int>(ui::MenuModel::TYPE_SUBMENU)) { |
69 Write(m, *p.items[i].submenu); | 69 Write(m, *p.items[i].submenu); |
70 } | 70 } |
71 } | 71 } |
72 } | 72 } |
73 | 73 |
74 // static | 74 // static |
75 bool ParamTraits<ContextMenuModel>::Read(const Message* m, | 75 bool ParamTraits<ContextMenuModel>::Read(const Message* m, |
76 void** iter, | 76 PickleIterator* iter, |
77 param_type* p) { | 77 param_type* p) { |
78 size_t item_count = 0; | 78 size_t item_count = 0; |
79 if (!ReadParam(m, iter, &item_count)) | 79 if (!ReadParam(m, iter, &item_count)) |
80 return false; | 80 return false; |
81 | 81 |
82 p->items.reserve(item_count); | 82 p->items.reserve(item_count); |
83 for (size_t i = 0; i < item_count; ++i) { | 83 for (size_t i = 0; i < item_count; ++i) { |
84 ContextMenuModel::Item item; | 84 ContextMenuModel::Item item; |
85 if (!ReadParam(m, iter, &item.type)) | 85 if (!ReadParam(m, iter, &item.type)) |
86 return false; | 86 return false; |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 } // namespace IPC | 138 } // namespace IPC |
OLD | NEW |