Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(132)

Side by Side Diff: chrome/common/automation_messages.h

Issue 5783004: Keep deinlining stuff. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Well, it all compiles locally? Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 #ifndef CHROME_COMMON_AUTOMATION_MESSAGES_H__ 5 #ifndef CHROME_COMMON_AUTOMATION_MESSAGES_H__
6 #define CHROME_COMMON_AUTOMATION_MESSAGES_H__ 6 #define CHROME_COMMON_AUTOMATION_MESSAGES_H__
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 21 matching lines...) Expand all
32 32
33 // Whether this operation is first request (Find) or a follow-up (FindNext). 33 // Whether this operation is first request (Find) or a follow-up (FindNext).
34 bool find_next; 34 bool find_next;
35 }; 35 };
36 36
37 namespace IPC { 37 namespace IPC {
38 38
39 template <> 39 template <>
40 struct ParamTraits<AutomationMsg_Find_Params> { 40 struct ParamTraits<AutomationMsg_Find_Params> {
41 typedef AutomationMsg_Find_Params param_type; 41 typedef AutomationMsg_Find_Params param_type;
42 static void Write(Message* m, const param_type& p) { 42 static void Write(Message* m, const param_type& p);
43 WriteParam(m, p.unused); 43 static bool Read(const Message* m, void** iter, param_type* p);
44 WriteParam(m, p.search_string); 44 static void Log(const param_type& p, std::string* l);
45 WriteParam(m, p.forward);
46 WriteParam(m, p.match_case);
47 WriteParam(m, p.find_next);
48 }
49 static bool Read(const Message* m, void** iter, param_type* p) {
50 return
51 ReadParam(m, iter, &p->unused) &&
52 ReadParam(m, iter, &p->search_string) &&
53 ReadParam(m, iter, &p->forward) &&
54 ReadParam(m, iter, &p->match_case) &&
55 ReadParam(m, iter, &p->find_next);
56 }
57 static void Log(const param_type& p, std::string* l) {
58 l->append("<AutomationMsg_Find_Params>");
59 }
60 }; 45 };
61 46
62 template <> 47 template <>
63 struct ParamTraits<AutomationMsg_NavigationResponseValues> { 48 struct ParamTraits<AutomationMsg_NavigationResponseValues> {
64 typedef AutomationMsg_NavigationResponseValues param_type; 49 typedef AutomationMsg_NavigationResponseValues param_type;
65 static void Write(Message* m, const param_type& p) { 50 static void Write(Message* m, const param_type& p);
66 m->WriteInt(p); 51 static bool Read(const Message* m, void** iter, param_type* p);
67 } 52 static void Log(const param_type& p, std::string* l);
68 static bool Read(const Message* m, void** iter, param_type* p) {
69 int type;
70 if (!m->ReadInt(iter, &type))
71 return false;
72 *p = static_cast<AutomationMsg_NavigationResponseValues>(type);
73 return true;
74 }
75 static void Log(const param_type& p, std::string* l) {
76 std::string control;
77 switch (p) {
78 case AUTOMATION_MSG_NAVIGATION_ERROR:
79 control = "AUTOMATION_MSG_NAVIGATION_ERROR";
80 break;
81 case AUTOMATION_MSG_NAVIGATION_SUCCESS:
82 control = "AUTOMATION_MSG_NAVIGATION_SUCCESS";
83 break;
84 case AUTOMATION_MSG_NAVIGATION_AUTH_NEEDED:
85 control = "AUTOMATION_MSG_NAVIGATION_AUTH_NEEDED";
86 break;
87 default:
88 control = "UNKNOWN";
89 break;
90 }
91
92 LogParam(control, l);
93 }
94 }; 53 };
95 54
96 template <> 55 template <>
97 struct ParamTraits<AutomationMsg_ExtensionResponseValues> { 56 struct ParamTraits<AutomationMsg_ExtensionResponseValues> {
98 typedef AutomationMsg_ExtensionResponseValues param_type; 57 typedef AutomationMsg_ExtensionResponseValues param_type;
99 static void Write(Message* m, const param_type& p) { 58 static void Write(Message* m, const param_type& p);
100 m->WriteInt(p); 59 static bool Read(const Message* m, void** iter, param_type* p);
101 } 60 static void Log(const param_type& p, std::string* l);
102 static bool Read(const Message* m, void** iter, param_type* p) {
103 int type;
104 if (!m->ReadInt(iter, &type))
105 return false;
106 *p = static_cast<AutomationMsg_ExtensionResponseValues>(type);
107 return true;
108 }
109 static void Log(const param_type& p, std::string* l) {
110 std::string control;
111 switch (p) {
112 case AUTOMATION_MSG_EXTENSION_INSTALL_SUCCEEDED:
113 control = "AUTOMATION_MSG_EXTENSION_INSTALL_SUCCEEDED";
114 break;
115 case AUTOMATION_MSG_EXTENSION_INSTALL_FAILED:
116 control = "AUTOMATION_MSG_EXTENSION_INSTALL_FAILED";
117 break;
118 default:
119 control = "UNKNOWN";
120 break;
121 }
122
123 LogParam(control, l);
124 }
125 }; 61 };
126 62
127 template <> 63 template <>
128 struct ParamTraits<AutomationMsg_ExtensionProperty> { 64 struct ParamTraits<AutomationMsg_ExtensionProperty> {
129 typedef AutomationMsg_ExtensionProperty param_type; 65 typedef AutomationMsg_ExtensionProperty param_type;
130 static void Write(Message* m, const param_type& p) { 66 static void Write(Message* m, const param_type& p);
131 m->WriteInt(p); 67 static bool Read(const Message* m, void** iter, param_type* p);
132 } 68 static void Log(const param_type& p, std::string* l);
133 static bool Read(const Message* m, void** iter, param_type* p) {
134 int type;
135 if (!m->ReadInt(iter, &type))
136 return false;
137 *p = static_cast<AutomationMsg_ExtensionProperty>(type);
138 return true;
139 }
140 static void Log(const param_type& p, std::string* l) {
141 std::string control;
142 switch (p) {
143 case AUTOMATION_MSG_EXTENSION_ID:
144 control = "AUTOMATION_MSG_EXTENSION_ID";
145 break;
146 case AUTOMATION_MSG_EXTENSION_NAME:
147 control = "AUTOMATION_MSG_EXTENSION_NAME";
148 break;
149 case AUTOMATION_MSG_EXTENSION_VERSION:
150 control = "AUTOMATION_MSG_EXTENSION_VERSION";
151 break;
152 case AUTOMATION_MSG_EXTENSION_BROWSER_ACTION_INDEX:
153 control = "AUTOMATION_MSG_EXTENSION_BROWSER_ACTION_INDEX";
154 break;
155 default:
156 control = "UNKNOWN";
157 break;
158 }
159
160 LogParam(control, l);
161 }
162 }; 69 };
163 70
164 template <> 71 template <>
165 struct ParamTraits<SecurityStyle> { 72 struct ParamTraits<SecurityStyle> {
166 typedef SecurityStyle param_type; 73 typedef SecurityStyle param_type;
167 static void Write(Message* m, const param_type& p) { 74 static void Write(Message* m, const param_type& p);
168 m->WriteInt(p); 75 static bool Read(const Message* m, void** iter, param_type* p);
169 } 76 static void Log(const param_type& p, std::string* l);
170 static bool Read(const Message* m, void** iter, param_type* p) {
171 int type;
172 if (!m->ReadInt(iter, &type))
173 return false;
174 *p = static_cast<SecurityStyle>(type);
175 return true;
176 }
177 static void Log(const param_type& p, std::string* l) {
178 std::string control;
179 switch (p) {
180 case SECURITY_STYLE_UNKNOWN:
181 control = "SECURITY_STYLE_UNKNOWN";
182 break;
183 case SECURITY_STYLE_UNAUTHENTICATED:
184 control = "SECURITY_STYLE_UNAUTHENTICATED";
185 break;
186 case SECURITY_STYLE_AUTHENTICATION_BROKEN:
187 control = "SECURITY_STYLE_AUTHENTICATION_BROKEN";
188 break;
189 case SECURITY_STYLE_AUTHENTICATED:
190 control = "SECURITY_STYLE_AUTHENTICATED";
191 break;
192 default:
193 control = "UNKNOWN";
194 break;
195 }
196
197 LogParam(control, l);
198 }
199 }; 77 };
200 78
201 template <> 79 template <>
202 struct ParamTraits<PageType> { 80 struct ParamTraits<PageType> {
203 typedef PageType param_type; 81 typedef PageType param_type;
204 static void Write(Message* m, const param_type& p) { 82 static void Write(Message* m, const param_type& p);
205 m->WriteInt(p); 83 static bool Read(const Message* m, void** iter, param_type* p);
206 } 84 static void Log(const param_type& p, std::string* l);
207 static bool Read(const Message* m, void** iter, param_type* p) {
208 int type;
209 if (!m->ReadInt(iter, &type))
210 return false;
211 *p = static_cast<PageType>(type);
212 return true;
213 }
214 static void Log(const param_type& p, std::string* l) {
215 std::string control;
216 switch (p) {
217 case NORMAL_PAGE:
218 control = "NORMAL_PAGE";
219 break;
220 case ERROR_PAGE:
221 control = "ERROR_PAGE";
222 break;
223 case INTERSTITIAL_PAGE:
224 control = "INTERSTITIAL_PAGE";
225 break;
226 default:
227 control = "UNKNOWN";
228 break;
229 }
230
231 LogParam(control, l);
232 }
233 }; 85 };
234 86
235 #if defined(OS_WIN) 87 #if defined(OS_WIN)
236 struct Reposition_Params { 88 struct Reposition_Params {
237 HWND window; 89 HWND window;
238 HWND window_insert_after; 90 HWND window_insert_after;
239 int left; 91 int left;
240 int top; 92 int top;
241 int width; 93 int width;
242 int height; 94 int height;
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 l->append(", "); 141 l->append(", ");
290 LogParam(p.set_parent, l); 142 LogParam(p.set_parent, l);
291 l->append(", "); 143 l->append(", ");
292 LogParam(p.parent_window, l); 144 LogParam(p.parent_window, l);
293 l->append(")"); 145 l->append(")");
294 } 146 }
295 }; 147 };
296 #endif // defined(OS_WIN) 148 #endif // defined(OS_WIN)
297 149
298 struct AutomationURLRequest { 150 struct AutomationURLRequest {
151 AutomationURLRequest();
152 AutomationURLRequest(const std::string& url,
153 const std::string& method,
154 const std::string& referrer,
155 const std::string& extra_request_headers,
156 scoped_refptr<net::UploadData> upload_data,
157 int resource_type,
158 int load_flags);
159 ~AutomationURLRequest();
160
299 std::string url; 161 std::string url;
300 std::string method; 162 std::string method;
301 std::string referrer; 163 std::string referrer;
302 std::string extra_request_headers; 164 std::string extra_request_headers;
303 scoped_refptr<net::UploadData> upload_data; 165 scoped_refptr<net::UploadData> upload_data;
304 int resource_type; // see webkit/glue/resource_type.h 166 int resource_type; // see webkit/glue/resource_type.h
305 int load_flags; // see net/base/load_flags.h 167 int load_flags; // see net/base/load_flags.h
306 }; 168 };
307 169
308 // Traits for AutomationURLRequest structure to pack/unpack. 170 // Traits for AutomationURLRequest structure to pack/unpack.
309 template <> 171 template <>
310 struct ParamTraits<AutomationURLRequest> { 172 struct ParamTraits<AutomationURLRequest> {
311 typedef AutomationURLRequest param_type; 173 typedef AutomationURLRequest param_type;
312 static void Write(Message* m, const param_type& p) { 174 static void Write(Message* m, const param_type& p);
313 WriteParam(m, p.url); 175 static bool Read(const Message* m, void** iter, param_type* p);
314 WriteParam(m, p.method); 176 static void Log(const param_type& p, std::string* l);
315 WriteParam(m, p.referrer);
316 WriteParam(m, p.extra_request_headers);
317 WriteParam(m, p.upload_data);
318 WriteParam(m, p.resource_type);
319 WriteParam(m, p.load_flags);
320 }
321 static bool Read(const Message* m, void** iter, param_type* p) {
322 return ReadParam(m, iter, &p->url) &&
323 ReadParam(m, iter, &p->method) &&
324 ReadParam(m, iter, &p->referrer) &&
325 ReadParam(m, iter, &p->extra_request_headers) &&
326 ReadParam(m, iter, &p->upload_data) &&
327 ReadParam(m, iter, &p->resource_type) &&
328 ReadParam(m, iter, &p->load_flags);
329 }
330 static void Log(const param_type& p, std::string* l) {
331 l->append("(");
332 LogParam(p.url, l);
333 l->append(", ");
334 LogParam(p.method, l);
335 l->append(", ");
336 LogParam(p.referrer, l);
337 l->append(", ");
338 LogParam(p.extra_request_headers, l);
339 l->append(", ");
340 LogParam(p.upload_data, l);
341 l->append(", ");
342 LogParam(p.resource_type, l);
343 l->append(", ");
344 LogParam(p.load_flags, l);
345 l->append(")");
346 }
347 }; 177 };
348 178
349 struct AutomationURLResponse { 179 struct AutomationURLResponse {
180 AutomationURLResponse();
181 AutomationURLResponse(const std::string& mime_type,
182 const std::string& headers,
183 int64 content_length,
184 const base::Time& last_modified,
185 const std::string& redirect_url,
186 int redirect_status);
187 ~AutomationURLResponse();
188
350 std::string mime_type; 189 std::string mime_type;
351 std::string headers; 190 std::string headers;
352 int64 content_length; 191 int64 content_length;
353 base::Time last_modified; 192 base::Time last_modified;
354 std::string redirect_url; 193 std::string redirect_url;
355 int redirect_status; 194 int redirect_status;
356 }; 195 };
357 196
358 // Traits for AutomationURLResponse structure to pack/unpack. 197 // Traits for AutomationURLResponse structure to pack/unpack.
359 template <> 198 template <>
360 struct ParamTraits<AutomationURLResponse> { 199 struct ParamTraits<AutomationURLResponse> {
361 typedef AutomationURLResponse param_type; 200 typedef AutomationURLResponse param_type;
362 static void Write(Message* m, const param_type& p) { 201 static void Write(Message* m, const param_type& p);
363 WriteParam(m, p.mime_type); 202 static bool Read(const Message* m, void** iter, param_type* p);
364 WriteParam(m, p.headers); 203 static void Log(const param_type& p, std::string* l);
365 WriteParam(m, p.content_length);
366 WriteParam(m, p.last_modified);
367 WriteParam(m, p.redirect_url);
368 WriteParam(m, p.redirect_status);
369 }
370 static bool Read(const Message* m, void** iter, param_type* p) {
371 return ReadParam(m, iter, &p->mime_type) &&
372 ReadParam(m, iter, &p->headers) &&
373 ReadParam(m, iter, &p->content_length) &&
374 ReadParam(m, iter, &p->last_modified) &&
375 ReadParam(m, iter, &p->redirect_url) &&
376 ReadParam(m, iter, &p->redirect_status);
377 }
378 static void Log(const param_type& p, std::string* l) {
379 l->append("(");
380 LogParam(p.mime_type, l);
381 l->append(", ");
382 LogParam(p.headers, l);
383 l->append(", ");
384 LogParam(p.content_length, l);
385 l->append(", ");
386 LogParam(p.last_modified, l);
387 l->append(", ");
388 LogParam(p.redirect_url, l);
389 l->append(", ");
390 LogParam(p.redirect_status, l);
391 l->append(")");
392 }
393 }; 204 };
394 205
395 struct ExternalTabSettings { 206 struct ExternalTabSettings {
207 ExternalTabSettings();
208 ExternalTabSettings(gfx::NativeWindow parent,
209 const gfx::Rect& dimensions,
210 unsigned int style,
211 bool is_off_the_record,
212 bool load_requests_via_automation,
213 bool handle_top_level_requests,
214 const GURL& initial_url,
215 const GURL& referrer,
216 bool infobars_enabled,
217 bool route_all_top_level_navigations);
218 ~ExternalTabSettings();
219
396 gfx::NativeWindow parent; 220 gfx::NativeWindow parent;
397 gfx::Rect dimensions; 221 gfx::Rect dimensions;
398 unsigned int style; 222 unsigned int style;
399 bool is_off_the_record; 223 bool is_off_the_record;
400 bool load_requests_via_automation; 224 bool load_requests_via_automation;
401 bool handle_top_level_requests; 225 bool handle_top_level_requests;
402 GURL initial_url; 226 GURL initial_url;
403 GURL referrer; 227 GURL referrer;
404 bool infobars_enabled; 228 bool infobars_enabled;
405 bool route_all_top_level_navigations; 229 bool route_all_top_level_navigations;
406 }; 230 };
407 231
408 // Traits for ExternalTabSettings structure to pack/unpack. 232 // Traits for ExternalTabSettings structure to pack/unpack.
409 template <> 233 template <>
410 struct ParamTraits<ExternalTabSettings> { 234 struct ParamTraits<ExternalTabSettings> {
411 typedef ExternalTabSettings param_type; 235 typedef ExternalTabSettings param_type;
412 static void Write(Message* m, const param_type& p) { 236 static void Write(Message* m, const param_type& p);
413 WriteParam(m, p.parent); 237 static bool Read(const Message* m, void** iter, param_type* p);
414 WriteParam(m, p.dimensions); 238 static void Log(const param_type& p, std::string* l);
415 WriteParam(m, p.style);
416 WriteParam(m, p.is_off_the_record);
417 WriteParam(m, p.load_requests_via_automation);
418 WriteParam(m, p.handle_top_level_requests);
419 WriteParam(m, p.initial_url);
420 WriteParam(m, p.referrer);
421 WriteParam(m, p.infobars_enabled);
422 WriteParam(m, p.route_all_top_level_navigations);
423 }
424 static bool Read(const Message* m, void** iter, param_type* p) {
425 return ReadParam(m, iter, &p->parent) &&
426 ReadParam(m, iter, &p->dimensions) &&
427 ReadParam(m, iter, &p->style) &&
428 ReadParam(m, iter, &p->is_off_the_record) &&
429 ReadParam(m, iter, &p->load_requests_via_automation) &&
430 ReadParam(m, iter, &p->handle_top_level_requests) &&
431 ReadParam(m, iter, &p->initial_url) &&
432 ReadParam(m, iter, &p->referrer) &&
433 ReadParam(m, iter, &p->infobars_enabled) &&
434 ReadParam(m, iter, &p->route_all_top_level_navigations);
435 }
436 static void Log(const param_type& p, std::string* l) {
437 l->append("(");
438 LogParam(p.parent, l);
439 l->append(", ");
440 LogParam(p.dimensions, l);
441 l->append(", ");
442 LogParam(p.style, l);
443 l->append(", ");
444 LogParam(p.is_off_the_record, l);
445 l->append(", ");
446 LogParam(p.load_requests_via_automation, l);
447 l->append(", ");
448 LogParam(p.handle_top_level_requests, l);
449 l->append(", ");
450 LogParam(p.initial_url, l);
451 l->append(", ");
452 LogParam(p.referrer, l);
453 l->append(", ");
454 LogParam(p.infobars_enabled, l);
455 l->append(", ");
456 LogParam(p.route_all_top_level_navigations, l);
457 l->append(")");
458 }
459 }; 239 };
460 240
461 struct NavigationInfo { 241 struct NavigationInfo {
242 NavigationInfo();
243 NavigationInfo(int navigation_type,
244 int relative_offset,
245 int navigation_index,
246 const std::wstring& title,
247 const GURL& url,
248 const GURL& referrer,
249 SecurityStyle security_style,
250 bool displayed_insecure_content,
251 bool ran_insecure_content);
252 ~NavigationInfo();
253
462 int navigation_type; 254 int navigation_type;
463 int relative_offset; 255 int relative_offset;
464 int navigation_index; 256 int navigation_index;
465 std::wstring title; 257 std::wstring title;
466 GURL url; 258 GURL url;
467 GURL referrer; 259 GURL referrer;
468 SecurityStyle security_style; 260 SecurityStyle security_style;
469 bool displayed_insecure_content; 261 bool displayed_insecure_content;
470 bool ran_insecure_content; 262 bool ran_insecure_content;
471 }; 263 };
472 264
473 // Traits for NavigationInfo structure to pack/unpack. 265 // Traits for NavigationInfo structure to pack/unpack.
474 template <> 266 template <>
475 struct ParamTraits<NavigationInfo> { 267 struct ParamTraits<NavigationInfo> {
476 typedef NavigationInfo param_type; 268 typedef NavigationInfo param_type;
477 static void Write(Message* m, const param_type& p) { 269 static void Write(Message* m, const param_type& p);
478 WriteParam(m, p.navigation_type); 270 static bool Read(const Message* m, void** iter, param_type* p);
479 WriteParam(m, p.relative_offset); 271 static void Log(const param_type& p, std::string* l);
480 WriteParam(m, p.navigation_index);
481 WriteParam(m, p.title);
482 WriteParam(m, p.url);
483 WriteParam(m, p.referrer);
484 WriteParam(m, p.security_style);
485 WriteParam(m, p.displayed_insecure_content);
486 WriteParam(m, p.ran_insecure_content);
487 }
488 static bool Read(const Message* m, void** iter, param_type* p) {
489 return ReadParam(m, iter, &p->navigation_type) &&
490 ReadParam(m, iter, &p->relative_offset) &&
491 ReadParam(m, iter, &p->navigation_index) &&
492 ReadParam(m, iter, &p->title) &&
493 ReadParam(m, iter, &p->url) &&
494 ReadParam(m, iter, &p->referrer) &&
495 ReadParam(m, iter, &p->security_style) &&
496 ReadParam(m, iter, &p->displayed_insecure_content) &&
497 ReadParam(m, iter, &p->ran_insecure_content);
498 }
499 static void Log(const param_type& p, std::string* l) {
500 l->append("(");
501 LogParam(p.navigation_type, l);
502 l->append(", ");
503 LogParam(p.relative_offset, l);
504 l->append(", ");
505 LogParam(p.navigation_index, l);
506 l->append(", ");
507 LogParam(p.title, l);
508 l->append(", ");
509 LogParam(p.url, l);
510 l->append(", ");
511 LogParam(p.referrer, l);
512 l->append(", ");
513 LogParam(p.security_style, l);
514 l->append(", ");
515 LogParam(p.displayed_insecure_content, l);
516 l->append(", ");
517 LogParam(p.ran_insecure_content, l);
518 l->append(")");
519 }
520 }; 272 };
521 273
522 // A stripped down version of ContextMenuParams in webkit/glue/context_menu.h. 274 // A stripped down version of ContextMenuParams in webkit/glue/context_menu.h.
523 struct MiniContextMenuParams { 275 struct MiniContextMenuParams {
276 MiniContextMenuParams();
277 MiniContextMenuParams(int screen_x,
278 int screen_y,
279 const GURL& link_url,
280 const GURL& unfiltered_link_url,
281 const GURL& src_url,
282 const GURL& page_url,
283 const GURL& frame_url);
284 ~MiniContextMenuParams();
285
524 // The x coordinate for displaying the menu. 286 // The x coordinate for displaying the menu.
525 int screen_x; 287 int screen_x;
526 288
527 // The y coordinate for displaying the menu. 289 // The y coordinate for displaying the menu.
528 int screen_y; 290 int screen_y;
529 291
530 // This is the URL of the link that encloses the node the context menu was 292 // This is the URL of the link that encloses the node the context menu was
531 // invoked on. 293 // invoked on.
532 GURL link_url; 294 GURL link_url;
533 295
(...skipping 11 matching lines...) Expand all
545 GURL page_url; 307 GURL page_url;
546 308
547 // This is the URL of the subframe that the context menu was invoked on. 309 // This is the URL of the subframe that the context menu was invoked on.
548 GURL frame_url; 310 GURL frame_url;
549 }; 311 };
550 312
551 // Traits for MiniContextMenuParams structure to pack/unpack. 313 // Traits for MiniContextMenuParams structure to pack/unpack.
552 template <> 314 template <>
553 struct ParamTraits<MiniContextMenuParams> { 315 struct ParamTraits<MiniContextMenuParams> {
554 typedef MiniContextMenuParams param_type; 316 typedef MiniContextMenuParams param_type;
555 static void Write(Message* m, const param_type& p) { 317 static void Write(Message* m, const param_type& p);
556 WriteParam(m, p.screen_x); 318 static bool Read(const Message* m, void** iter, param_type* p);
557 WriteParam(m, p.screen_y); 319 static void Log(const param_type& p, std::string* l);
558 WriteParam(m, p.link_url);
559 WriteParam(m, p.unfiltered_link_url);
560 WriteParam(m, p.src_url);
561 WriteParam(m, p.page_url);
562 WriteParam(m, p.frame_url);
563 }
564 static bool Read(const Message* m, void** iter, param_type* p) {
565 return ReadParam(m, iter, &p->screen_x) &&
566 ReadParam(m, iter, &p->screen_y) &&
567 ReadParam(m, iter, &p->link_url) &&
568 ReadParam(m, iter, &p->unfiltered_link_url) &&
569 ReadParam(m, iter, &p->src_url) &&
570 ReadParam(m, iter, &p->page_url) &&
571 ReadParam(m, iter, &p->frame_url);
572 }
573 static void Log(const param_type& p, std::string* l) {
574 l->append("(");
575 LogParam(p.screen_x, l);
576 l->append(", ");
577 LogParam(p.screen_y, l);
578 l->append(", ");
579 LogParam(p.link_url, l);
580 l->append(", ");
581 LogParam(p.unfiltered_link_url, l);
582 l->append(", ");
583 LogParam(p.src_url, l);
584 l->append(", ");
585 LogParam(p.page_url, l);
586 l->append(", ");
587 LogParam(p.frame_url, l);
588 l->append(")");
589 }
590 }; 320 };
591 321
592 struct AttachExternalTabParams { 322 struct AttachExternalTabParams {
323 AttachExternalTabParams();
324 AttachExternalTabParams(uint64 cookie,
325 const GURL& url,
326 const gfx::Rect& dimensions,
327 int disposition,
328 bool user_gesture,
329 const std::string& profile_name);
330 ~AttachExternalTabParams();
331
593 uint64 cookie; 332 uint64 cookie;
594 GURL url; 333 GURL url;
595 gfx::Rect dimensions; 334 gfx::Rect dimensions;
596 int disposition; 335 int disposition;
597 bool user_gesture; 336 bool user_gesture;
598 std::string profile_name; 337 std::string profile_name;
599 }; 338 };
600 339
601 template <> 340 template <>
602 struct ParamTraits<AttachExternalTabParams> { 341 struct ParamTraits<AttachExternalTabParams> {
603 typedef AttachExternalTabParams param_type; 342 typedef AttachExternalTabParams param_type;
604 static void Write(Message* m, const param_type& p) { 343 static void Write(Message* m, const param_type& p);
605 WriteParam(m, p.cookie); 344 static bool Read(const Message* m, void** iter, param_type* p);
606 WriteParam(m, p.url); 345 static void Log(const param_type& p, std::string* l);
607 WriteParam(m, p.dimensions);
608 WriteParam(m, p.disposition);
609 WriteParam(m, p.user_gesture);
610 WriteParam(m, p.profile_name);
611 }
612
613 static bool Read(const Message* m, void** iter, param_type* p) {
614 return ReadParam(m, iter, &p->cookie) &&
615 ReadParam(m, iter, &p->url) &&
616 ReadParam(m, iter, &p->dimensions) &&
617 ReadParam(m, iter, &p->disposition) &&
618 ReadParam(m, iter, &p->user_gesture) &&
619 ReadParam(m, iter, &p->profile_name);
620 }
621
622 static void Log(const param_type& p, std::string* l) {
623 l->append("(");
624 LogParam(p.cookie, l);
625 l->append(", ");
626 LogParam(p.url, l);
627 l->append(", ");
628 LogParam(p.dimensions, l);
629 l->append(", ");
630 LogParam(p.disposition, l);
631 l->append(", ");
632 LogParam(p.user_gesture, l);
633 l->append(",");
634 LogParam(p.profile_name, l);
635 l->append(")");
636 }
637 }; 346 };
638 347
639 } // namespace IPC 348 } // namespace IPC
640 349
641 #include "chrome/common/automation_messages_internal.h" 350 #include "chrome/common/automation_messages_internal.h"
642 351
643 #endif // CHROME_COMMON_AUTOMATION_MESSAGES_H__ 352 #endif // CHROME_COMMON_AUTOMATION_MESSAGES_H__
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698