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, no traditional include guard. | 5 // Multiply-included message file, no traditional include guard. |
6 #include <string> | 6 #include <string> |
7 #include <vector> | |
7 | 8 |
8 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/memory/ref_counted.h" | |
9 #include "chrome/common/automation_constants.h" | 11 #include "chrome/common/automation_constants.h" |
10 #include "chrome/common/content_settings.h" | 12 #include "chrome/common/content_settings.h" |
11 #include "content/common/common_param_traits.h" | 13 #include "content/common/common_param_traits.h" |
12 #include "content/common/page_type.h" | 14 #include "content/common/page_type.h" |
13 #include "content/common/security_style.h" | 15 #include "content/common/security_style.h" |
14 #include "content/common/webkit_param_traits.h" | 16 #include "content/common/webkit_param_traits.h" |
15 #include "ipc/ipc_message_macros.h" | 17 #include "ipc/ipc_message_macros.h" |
16 #include "ipc/ipc_message_utils.h" | 18 #include "ipc/ipc_message_utils.h" |
17 #include "net/base/host_port_pair.h" | 19 #include "net/base/host_port_pair.h" |
18 #include "net/base/upload_data.h" | 20 #include "net/base/upload_data.h" |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
141 GURL src_url; | 143 GURL src_url; |
142 | 144 |
143 // This is the URL of the top level page that the context menu was invoked | 145 // This is the URL of the top level page that the context menu was invoked |
144 // on. | 146 // on. |
145 GURL page_url; | 147 GURL page_url; |
146 | 148 |
147 // This is the URL of the subframe that the context menu was invoked on. | 149 // This is the URL of the subframe that the context menu was invoked on. |
148 GURL frame_url; | 150 GURL frame_url; |
149 }; | 151 }; |
150 | 152 |
153 // This struct contains information from ui::MenuModel in Chrome to Chrome | |
154 // Frame for the RenderViewContextMenu. It is basically a container of | |
155 // items that go in the menu. An item may be a submenu, so the data | |
156 // structure may be a tree. | |
157 struct ContextMenuModel { | |
iyengar
2011/07/11 22:09:17
We can probably reword the comment as below:-
"Thi
rhashimoto
2011/07/11 22:38:58
Done.
| |
158 ContextMenuModel(); | |
159 ~ContextMenuModel(); | |
160 | |
161 // This struct describes one item in the menu. | |
162 struct Item { | |
163 Item(); | |
164 | |
165 // This is the type of the menu item, using values from the enum | |
166 // ui::MenuModel::ItemType (serialized as an int). | |
167 int type; | |
168 | |
169 // This is the command id of the menu item, which will be passed by | |
170 // to Chrome if the item is selected. | |
171 int item_id; | |
iyengar
2011/07/11 22:09:17
which will be passed by Chrome to ChromeFrame?
rhashimoto
2011/07/11 22:38:58
Done.
| |
172 | |
173 // This the the menu label, if needed. | |
174 std::wstring label; | |
175 | |
176 // These are states of the menu item. | |
177 bool checked; | |
178 bool enabled; | |
179 | |
180 // This recursively describes the submenu if type is | |
181 // ui::MenuModel::TYPE_SUBMENU. | |
182 ContextMenuModel* submenu; | |
183 }; | |
184 | |
185 // This is the list of menu items. | |
186 std::vector<Item> items; | |
187 }; | |
188 | |
151 struct AttachExternalTabParams { | 189 struct AttachExternalTabParams { |
152 AttachExternalTabParams(); | 190 AttachExternalTabParams(); |
153 AttachExternalTabParams(uint64 cookie, | 191 AttachExternalTabParams(uint64 cookie, |
154 const GURL& url, | 192 const GURL& url, |
155 const gfx::Rect& dimensions, | 193 const gfx::Rect& dimensions, |
156 int disposition, | 194 int disposition, |
157 bool user_gesture, | 195 bool user_gesture, |
158 const std::string& profile_name); | 196 const std::string& profile_name); |
159 ~AttachExternalTabParams(); | 197 ~AttachExternalTabParams(); |
160 | 198 |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
342 | 380 |
343 // Traits for MiniContextMenuParams structure to pack/unpack. | 381 // Traits for MiniContextMenuParams structure to pack/unpack. |
344 template <> | 382 template <> |
345 struct ParamTraits<MiniContextMenuParams> { | 383 struct ParamTraits<MiniContextMenuParams> { |
346 typedef MiniContextMenuParams param_type; | 384 typedef MiniContextMenuParams param_type; |
347 static void Write(Message* m, const param_type& p); | 385 static void Write(Message* m, const param_type& p); |
348 static bool Read(const Message* m, void** iter, param_type* p); | 386 static bool Read(const Message* m, void** iter, param_type* p); |
349 static void Log(const param_type& p, std::string* l); | 387 static void Log(const param_type& p, std::string* l); |
350 }; | 388 }; |
351 | 389 |
390 // Traits for ContextMenuModel structure to pack/unpack. | |
391 template <> | |
392 struct ParamTraits<ContextMenuModel> { | |
393 typedef ContextMenuModel param_type; | |
394 static void Write(Message* m, const param_type& p); | |
395 static bool Read(const Message* m, void** iter, param_type* p); | |
396 static void Log(const param_type& p, std::string* l); | |
397 }; | |
398 | |
352 template <> | 399 template <> |
353 struct ParamTraits<AttachExternalTabParams> { | 400 struct ParamTraits<AttachExternalTabParams> { |
354 typedef AttachExternalTabParams param_type; | 401 typedef AttachExternalTabParams param_type; |
355 static void Write(Message* m, const param_type& p); | 402 static void Write(Message* m, const param_type& p); |
356 static bool Read(const Message* m, void** iter, param_type* p); | 403 static bool Read(const Message* m, void** iter, param_type* p); |
357 static void Log(const param_type& p, std::string* l); | 404 static void Log(const param_type& p, std::string* l); |
358 }; | 405 }; |
359 | 406 |
360 } // namespace IPC | 407 } // namespace IPC |
361 | 408 |
362 #endif // CHROME_COMMON_AUTOMATION_MESSAGES_H__ | 409 #endif // CHROME_COMMON_AUTOMATION_MESSAGES_H__ |
363 | 410 |
364 // Keep this internal message file unchanged to preserve line numbering | 411 // Keep this internal message file unchanged to preserve line numbering |
365 // (and hence the dubious __LINE__-based message numberings) across versions. | 412 // (and hence the dubious __LINE__-based message numberings) across versions. |
366 #include "chrome/common/automation_messages_internal.h" | 413 #include "chrome/common/automation_messages_internal.h" |
367 | 414 |
OLD | NEW |