OLD | NEW |
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 #define IPC_MESSAGE_IMPL | 5 #define IPC_MESSAGE_IMPL |
6 #include "chrome/common/automation_messages.h" | 6 #include "chrome/common/automation_messages.h" |
| 7 |
| 8 namespace IPC { |
| 9 |
| 10 // static |
| 11 void ParamTraits<AutomationMsg_Find_Params>::Write(Message* m, |
| 12 const param_type& p) { |
| 13 WriteParam(m, p.unused); |
| 14 WriteParam(m, p.search_string); |
| 15 WriteParam(m, p.forward); |
| 16 WriteParam(m, p.match_case); |
| 17 WriteParam(m, p.find_next); |
| 18 } |
| 19 |
| 20 // static |
| 21 bool ParamTraits<AutomationMsg_Find_Params>::Read(const Message* m, |
| 22 void** iter, |
| 23 param_type* p) { |
| 24 return |
| 25 ReadParam(m, iter, &p->unused) && |
| 26 ReadParam(m, iter, &p->search_string) && |
| 27 ReadParam(m, iter, &p->forward) && |
| 28 ReadParam(m, iter, &p->match_case) && |
| 29 ReadParam(m, iter, &p->find_next); |
| 30 } |
| 31 |
| 32 // static |
| 33 void ParamTraits<AutomationMsg_Find_Params>::Log(const param_type& p, |
| 34 std::string* l) { |
| 35 l->append("<AutomationMsg_Find_Params>"); |
| 36 } |
| 37 |
| 38 // static |
| 39 void ParamTraits<AutomationMsg_NavigationResponseValues>::Write( |
| 40 Message* m, |
| 41 const param_type& p) { |
| 42 m->WriteInt(p); |
| 43 } |
| 44 |
| 45 // static |
| 46 bool ParamTraits<AutomationMsg_NavigationResponseValues>::Read(const Message* m, |
| 47 void** iter, |
| 48 param_type* p) { |
| 49 int type; |
| 50 if (!m->ReadInt(iter, &type)) |
| 51 return false; |
| 52 *p = static_cast<AutomationMsg_NavigationResponseValues>(type); |
| 53 return true; |
| 54 } |
| 55 |
| 56 // static |
| 57 void ParamTraits<AutomationMsg_NavigationResponseValues>::Log( |
| 58 const param_type& p, std::string* l) { |
| 59 std::string control; |
| 60 switch (p) { |
| 61 case AUTOMATION_MSG_NAVIGATION_ERROR: |
| 62 control = "AUTOMATION_MSG_NAVIGATION_ERROR"; |
| 63 break; |
| 64 case AUTOMATION_MSG_NAVIGATION_SUCCESS: |
| 65 control = "AUTOMATION_MSG_NAVIGATION_SUCCESS"; |
| 66 break; |
| 67 case AUTOMATION_MSG_NAVIGATION_AUTH_NEEDED: |
| 68 control = "AUTOMATION_MSG_NAVIGATION_AUTH_NEEDED"; |
| 69 break; |
| 70 default: |
| 71 control = "UNKNOWN"; |
| 72 break; |
| 73 } |
| 74 |
| 75 LogParam(control, l); |
| 76 } |
| 77 |
| 78 // static |
| 79 void ParamTraits<AutomationMsg_ExtensionResponseValues>::Write( |
| 80 Message* m, |
| 81 const param_type& p) { |
| 82 m->WriteInt(p); |
| 83 } |
| 84 |
| 85 // static |
| 86 bool ParamTraits<AutomationMsg_ExtensionResponseValues>::Read( |
| 87 const Message* m, |
| 88 void** iter, |
| 89 param_type* p) { |
| 90 int type; |
| 91 if (!m->ReadInt(iter, &type)) |
| 92 return false; |
| 93 *p = static_cast<AutomationMsg_ExtensionResponseValues>(type); |
| 94 return true; |
| 95 } |
| 96 |
| 97 // static |
| 98 void ParamTraits<AutomationMsg_ExtensionResponseValues>::Log( |
| 99 const param_type& p, |
| 100 std::string* l) { |
| 101 std::string control; |
| 102 switch (p) { |
| 103 case AUTOMATION_MSG_EXTENSION_INSTALL_SUCCEEDED: |
| 104 control = "AUTOMATION_MSG_EXTENSION_INSTALL_SUCCEEDED"; |
| 105 break; |
| 106 case AUTOMATION_MSG_EXTENSION_INSTALL_FAILED: |
| 107 control = "AUTOMATION_MSG_EXTENSION_INSTALL_FAILED"; |
| 108 break; |
| 109 default: |
| 110 control = "UNKNOWN"; |
| 111 break; |
| 112 } |
| 113 |
| 114 LogParam(control, l); |
| 115 } |
| 116 |
| 117 // static |
| 118 void ParamTraits<AutomationMsg_ExtensionProperty>::Write(Message* m, |
| 119 const param_type& p) { |
| 120 m->WriteInt(p); |
| 121 } |
| 122 |
| 123 // static |
| 124 bool ParamTraits<AutomationMsg_ExtensionProperty>::Read(const Message* m, |
| 125 void** iter, |
| 126 param_type* p) { |
| 127 int type; |
| 128 if (!m->ReadInt(iter, &type)) |
| 129 return false; |
| 130 *p = static_cast<AutomationMsg_ExtensionProperty>(type); |
| 131 return true; |
| 132 } |
| 133 |
| 134 // static |
| 135 void ParamTraits<AutomationMsg_ExtensionProperty>::Log(const param_type& p, |
| 136 std::string* l) { |
| 137 std::string control; |
| 138 switch (p) { |
| 139 case AUTOMATION_MSG_EXTENSION_ID: |
| 140 control = "AUTOMATION_MSG_EXTENSION_ID"; |
| 141 break; |
| 142 case AUTOMATION_MSG_EXTENSION_NAME: |
| 143 control = "AUTOMATION_MSG_EXTENSION_NAME"; |
| 144 break; |
| 145 case AUTOMATION_MSG_EXTENSION_VERSION: |
| 146 control = "AUTOMATION_MSG_EXTENSION_VERSION"; |
| 147 break; |
| 148 case AUTOMATION_MSG_EXTENSION_BROWSER_ACTION_INDEX: |
| 149 control = "AUTOMATION_MSG_EXTENSION_BROWSER_ACTION_INDEX"; |
| 150 break; |
| 151 default: |
| 152 control = "UNKNOWN"; |
| 153 break; |
| 154 } |
| 155 |
| 156 LogParam(control, l); |
| 157 } |
| 158 |
| 159 // static |
| 160 void ParamTraits<SecurityStyle>::Write(Message* m, const param_type& p) { |
| 161 m->WriteInt(p); |
| 162 } |
| 163 |
| 164 // static |
| 165 bool ParamTraits<SecurityStyle>::Read(const Message* m, |
| 166 void** iter, |
| 167 param_type* p) { |
| 168 int type; |
| 169 if (!m->ReadInt(iter, &type)) |
| 170 return false; |
| 171 *p = static_cast<SecurityStyle>(type); |
| 172 return true; |
| 173 } |
| 174 |
| 175 // static |
| 176 void ParamTraits<SecurityStyle>::Log(const param_type& p, std::string* l) { |
| 177 std::string control; |
| 178 switch (p) { |
| 179 case SECURITY_STYLE_UNKNOWN: |
| 180 control = "SECURITY_STYLE_UNKNOWN"; |
| 181 break; |
| 182 case SECURITY_STYLE_UNAUTHENTICATED: |
| 183 control = "SECURITY_STYLE_UNAUTHENTICATED"; |
| 184 break; |
| 185 case SECURITY_STYLE_AUTHENTICATION_BROKEN: |
| 186 control = "SECURITY_STYLE_AUTHENTICATION_BROKEN"; |
| 187 break; |
| 188 case SECURITY_STYLE_AUTHENTICATED: |
| 189 control = "SECURITY_STYLE_AUTHENTICATED"; |
| 190 break; |
| 191 default: |
| 192 control = "UNKNOWN"; |
| 193 break; |
| 194 } |
| 195 |
| 196 LogParam(control, l); |
| 197 } |
| 198 |
| 199 // static |
| 200 void ParamTraits<PageType>::Write(Message* m, const param_type& p) { |
| 201 m->WriteInt(p); |
| 202 } |
| 203 |
| 204 // static |
| 205 bool ParamTraits<PageType>::Read(const Message* m, void** iter, param_type* p) { |
| 206 int type; |
| 207 if (!m->ReadInt(iter, &type)) |
| 208 return false; |
| 209 *p = static_cast<PageType>(type); |
| 210 return true; |
| 211 } |
| 212 |
| 213 // static |
| 214 void ParamTraits<PageType>::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 |
| 234 AutomationURLRequest::AutomationURLRequest() |
| 235 : resource_type(0), |
| 236 load_flags(0) { |
| 237 } |
| 238 |
| 239 AutomationURLRequest::AutomationURLRequest( |
| 240 const std::string& in_url, |
| 241 const std::string& in_method, |
| 242 const std::string& in_referrer, |
| 243 const std::string& in_extra_request_headers, |
| 244 scoped_refptr<net::UploadData> in_upload_data, |
| 245 int in_resource_type, |
| 246 int in_load_flags) |
| 247 : url(in_url), |
| 248 method(in_method), |
| 249 referrer(in_referrer), |
| 250 extra_request_headers(in_extra_request_headers), |
| 251 upload_data(in_upload_data), |
| 252 resource_type(in_resource_type), |
| 253 load_flags(in_load_flags) { |
| 254 } |
| 255 |
| 256 AutomationURLRequest::~AutomationURLRequest() {} |
| 257 |
| 258 // static |
| 259 void ParamTraits<AutomationURLRequest>::Write(Message* m, const param_type& p) { |
| 260 WriteParam(m, p.url); |
| 261 WriteParam(m, p.method); |
| 262 WriteParam(m, p.referrer); |
| 263 WriteParam(m, p.extra_request_headers); |
| 264 WriteParam(m, p.upload_data); |
| 265 WriteParam(m, p.resource_type); |
| 266 WriteParam(m, p.load_flags); |
| 267 } |
| 268 |
| 269 // static |
| 270 bool ParamTraits<AutomationURLRequest>::Read(const Message* m, |
| 271 void** iter, |
| 272 param_type* p) { |
| 273 return ReadParam(m, iter, &p->url) && |
| 274 ReadParam(m, iter, &p->method) && |
| 275 ReadParam(m, iter, &p->referrer) && |
| 276 ReadParam(m, iter, &p->extra_request_headers) && |
| 277 ReadParam(m, iter, &p->upload_data) && |
| 278 ReadParam(m, iter, &p->resource_type) && |
| 279 ReadParam(m, iter, &p->load_flags); |
| 280 } |
| 281 |
| 282 // static |
| 283 void ParamTraits<AutomationURLRequest>::Log(const param_type& p, |
| 284 std::string* l) { |
| 285 l->append("("); |
| 286 LogParam(p.url, l); |
| 287 l->append(", "); |
| 288 LogParam(p.method, l); |
| 289 l->append(", "); |
| 290 LogParam(p.referrer, l); |
| 291 l->append(", "); |
| 292 LogParam(p.extra_request_headers, l); |
| 293 l->append(", "); |
| 294 LogParam(p.upload_data, l); |
| 295 l->append(", "); |
| 296 LogParam(p.resource_type, l); |
| 297 l->append(", "); |
| 298 LogParam(p.load_flags, l); |
| 299 l->append(")"); |
| 300 } |
| 301 |
| 302 AutomationURLResponse::AutomationURLResponse() |
| 303 : content_length(0), |
| 304 redirect_status(0) { |
| 305 } |
| 306 |
| 307 AutomationURLResponse::AutomationURLResponse(const std::string& in_mime_type, |
| 308 const std::string& in_headers, |
| 309 int64 in_content_length, |
| 310 const base::Time& in_last_modified, |
| 311 const std::string& in_redirect_url, |
| 312 int in_redirect_status) |
| 313 : mime_type(in_mime_type), |
| 314 headers(in_headers), |
| 315 content_length(in_content_length), |
| 316 last_modified(in_last_modified), |
| 317 redirect_url(in_redirect_url), |
| 318 redirect_status(in_redirect_status) { |
| 319 } |
| 320 |
| 321 |
| 322 AutomationURLResponse::~AutomationURLResponse() {} |
| 323 |
| 324 // static |
| 325 void ParamTraits<AutomationURLResponse>::Write(Message* m, |
| 326 const param_type& p) { |
| 327 WriteParam(m, p.mime_type); |
| 328 WriteParam(m, p.headers); |
| 329 WriteParam(m, p.content_length); |
| 330 WriteParam(m, p.last_modified); |
| 331 WriteParam(m, p.redirect_url); |
| 332 WriteParam(m, p.redirect_status); |
| 333 } |
| 334 |
| 335 // static |
| 336 bool ParamTraits<AutomationURLResponse>::Read(const Message* m, |
| 337 void** iter, |
| 338 param_type* p) { |
| 339 return ReadParam(m, iter, &p->mime_type) && |
| 340 ReadParam(m, iter, &p->headers) && |
| 341 ReadParam(m, iter, &p->content_length) && |
| 342 ReadParam(m, iter, &p->last_modified) && |
| 343 ReadParam(m, iter, &p->redirect_url) && |
| 344 ReadParam(m, iter, &p->redirect_status); |
| 345 } |
| 346 |
| 347 // static |
| 348 void ParamTraits<AutomationURLResponse>::Log(const param_type& p, |
| 349 std::string* l) { |
| 350 l->append("("); |
| 351 LogParam(p.mime_type, l); |
| 352 l->append(", "); |
| 353 LogParam(p.headers, l); |
| 354 l->append(", "); |
| 355 LogParam(p.content_length, l); |
| 356 l->append(", "); |
| 357 LogParam(p.last_modified, l); |
| 358 l->append(", "); |
| 359 LogParam(p.redirect_url, l); |
| 360 l->append(", "); |
| 361 LogParam(p.redirect_status, l); |
| 362 l->append(")"); |
| 363 } |
| 364 |
| 365 ExternalTabSettings::ExternalTabSettings() |
| 366 : parent(NULL), |
| 367 dimensions(), |
| 368 style(0), |
| 369 is_off_the_record(false), |
| 370 load_requests_via_automation(false), |
| 371 handle_top_level_requests(false), |
| 372 initial_url(), |
| 373 referrer(), |
| 374 infobars_enabled(false), |
| 375 route_all_top_level_navigations(false) { |
| 376 } |
| 377 |
| 378 ExternalTabSettings::ExternalTabSettings( |
| 379 gfx::NativeWindow in_parent, |
| 380 const gfx::Rect& in_dimensions, |
| 381 unsigned int in_style, |
| 382 bool in_is_off_the_record, |
| 383 bool in_load_requests_via_automation, |
| 384 bool in_handle_top_level_requests, |
| 385 const GURL& in_initial_url, |
| 386 const GURL& in_referrer, |
| 387 bool in_infobars_enabled, |
| 388 bool in_route_all_top_level_navigations) |
| 389 : parent(in_parent), |
| 390 dimensions(in_dimensions), |
| 391 style(in_style), |
| 392 is_off_the_record(in_is_off_the_record), |
| 393 load_requests_via_automation(in_load_requests_via_automation), |
| 394 handle_top_level_requests(in_handle_top_level_requests), |
| 395 initial_url(in_initial_url), |
| 396 referrer(in_referrer), |
| 397 infobars_enabled(in_infobars_enabled), |
| 398 route_all_top_level_navigations(in_route_all_top_level_navigations) { |
| 399 } |
| 400 |
| 401 ExternalTabSettings::~ExternalTabSettings() {} |
| 402 |
| 403 // static |
| 404 void ParamTraits<ExternalTabSettings>::Write(Message* m, |
| 405 const param_type& p) { |
| 406 WriteParam(m, p.parent); |
| 407 WriteParam(m, p.dimensions); |
| 408 WriteParam(m, p.style); |
| 409 WriteParam(m, p.is_off_the_record); |
| 410 WriteParam(m, p.load_requests_via_automation); |
| 411 WriteParam(m, p.handle_top_level_requests); |
| 412 WriteParam(m, p.initial_url); |
| 413 WriteParam(m, p.referrer); |
| 414 WriteParam(m, p.infobars_enabled); |
| 415 WriteParam(m, p.route_all_top_level_navigations); |
| 416 } |
| 417 |
| 418 // static |
| 419 bool ParamTraits<ExternalTabSettings>::Read(const Message* m, |
| 420 void** iter, |
| 421 param_type* p) { |
| 422 return ReadParam(m, iter, &p->parent) && |
| 423 ReadParam(m, iter, &p->dimensions) && |
| 424 ReadParam(m, iter, &p->style) && |
| 425 ReadParam(m, iter, &p->is_off_the_record) && |
| 426 ReadParam(m, iter, &p->load_requests_via_automation) && |
| 427 ReadParam(m, iter, &p->handle_top_level_requests) && |
| 428 ReadParam(m, iter, &p->initial_url) && |
| 429 ReadParam(m, iter, &p->referrer) && |
| 430 ReadParam(m, iter, &p->infobars_enabled) && |
| 431 ReadParam(m, iter, &p->route_all_top_level_navigations); |
| 432 } |
| 433 |
| 434 // static |
| 435 void ParamTraits<ExternalTabSettings>::Log(const param_type& p, |
| 436 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 |
| 460 NavigationInfo::NavigationInfo() |
| 461 : navigation_type(0), |
| 462 relative_offset(0), |
| 463 navigation_index(0), |
| 464 displayed_insecure_content(0), |
| 465 ran_insecure_content(0) { |
| 466 } |
| 467 |
| 468 NavigationInfo::NavigationInfo(int in_navigation_type, |
| 469 int in_relative_offset, |
| 470 int in_navigation_index, |
| 471 const std::wstring& in_title, |
| 472 const GURL& in_url, |
| 473 const GURL& in_referrer, |
| 474 SecurityStyle in_security_style, |
| 475 bool in_displayed_insecure_content, |
| 476 bool in_ran_insecure_content) |
| 477 : navigation_type(in_navigation_type), |
| 478 relative_offset(in_relative_offset), |
| 479 navigation_index(in_navigation_index), |
| 480 title(in_title), |
| 481 url(in_url), |
| 482 referrer(in_referrer), |
| 483 security_style(in_security_style), |
| 484 displayed_insecure_content(in_displayed_insecure_content), |
| 485 ran_insecure_content(in_ran_insecure_content) { |
| 486 } |
| 487 |
| 488 NavigationInfo::~NavigationInfo() {} |
| 489 |
| 490 // static |
| 491 void ParamTraits<NavigationInfo>::Write(Message* m, const param_type& p) { |
| 492 WriteParam(m, p.navigation_type); |
| 493 WriteParam(m, p.relative_offset); |
| 494 WriteParam(m, p.navigation_index); |
| 495 WriteParam(m, p.title); |
| 496 WriteParam(m, p.url); |
| 497 WriteParam(m, p.referrer); |
| 498 WriteParam(m, p.security_style); |
| 499 WriteParam(m, p.displayed_insecure_content); |
| 500 WriteParam(m, p.ran_insecure_content); |
| 501 } |
| 502 |
| 503 // static |
| 504 bool ParamTraits<NavigationInfo>::Read(const Message* m, |
| 505 void** iter, |
| 506 param_type* p) { |
| 507 return ReadParam(m, iter, &p->navigation_type) && |
| 508 ReadParam(m, iter, &p->relative_offset) && |
| 509 ReadParam(m, iter, &p->navigation_index) && |
| 510 ReadParam(m, iter, &p->title) && |
| 511 ReadParam(m, iter, &p->url) && |
| 512 ReadParam(m, iter, &p->referrer) && |
| 513 ReadParam(m, iter, &p->security_style) && |
| 514 ReadParam(m, iter, &p->displayed_insecure_content) && |
| 515 ReadParam(m, iter, &p->ran_insecure_content); |
| 516 } |
| 517 |
| 518 // static |
| 519 void ParamTraits<NavigationInfo>::Log(const param_type& p, std::string* l) { |
| 520 l->append("("); |
| 521 LogParam(p.navigation_type, l); |
| 522 l->append(", "); |
| 523 LogParam(p.relative_offset, l); |
| 524 l->append(", "); |
| 525 LogParam(p.navigation_index, l); |
| 526 l->append(", "); |
| 527 LogParam(p.title, l); |
| 528 l->append(", "); |
| 529 LogParam(p.url, l); |
| 530 l->append(", "); |
| 531 LogParam(p.referrer, l); |
| 532 l->append(", "); |
| 533 LogParam(p.security_style, l); |
| 534 l->append(", "); |
| 535 LogParam(p.displayed_insecure_content, l); |
| 536 l->append(", "); |
| 537 LogParam(p.ran_insecure_content, l); |
| 538 l->append(")"); |
| 539 } |
| 540 |
| 541 MiniContextMenuParams::MiniContextMenuParams() |
| 542 : screen_x(0), |
| 543 screen_y(0) { |
| 544 } |
| 545 |
| 546 MiniContextMenuParams::MiniContextMenuParams(int in_screen_x, |
| 547 int in_screen_y, |
| 548 const GURL& in_link_url, |
| 549 const GURL& in_unfiltered_link_url, |
| 550 const GURL& in_src_url, |
| 551 const GURL& in_page_url, |
| 552 const GURL& in_frame_url) |
| 553 : screen_x(in_screen_x), |
| 554 screen_y(in_screen_y), |
| 555 link_url(in_link_url), |
| 556 unfiltered_link_url(in_unfiltered_link_url), |
| 557 src_url(in_src_url), |
| 558 page_url(in_page_url), |
| 559 frame_url(in_frame_url) { |
| 560 } |
| 561 |
| 562 MiniContextMenuParams::~MiniContextMenuParams() {} |
| 563 |
| 564 // static |
| 565 void ParamTraits<MiniContextMenuParams>::Write(Message* m, |
| 566 const param_type& p) { |
| 567 WriteParam(m, p.screen_x); |
| 568 WriteParam(m, p.screen_y); |
| 569 WriteParam(m, p.link_url); |
| 570 WriteParam(m, p.unfiltered_link_url); |
| 571 WriteParam(m, p.src_url); |
| 572 WriteParam(m, p.page_url); |
| 573 WriteParam(m, p.frame_url); |
| 574 } |
| 575 |
| 576 // static |
| 577 bool ParamTraits<MiniContextMenuParams>::Read(const Message* m, |
| 578 void** iter, |
| 579 param_type* p) { |
| 580 return ReadParam(m, iter, &p->screen_x) && |
| 581 ReadParam(m, iter, &p->screen_y) && |
| 582 ReadParam(m, iter, &p->link_url) && |
| 583 ReadParam(m, iter, &p->unfiltered_link_url) && |
| 584 ReadParam(m, iter, &p->src_url) && |
| 585 ReadParam(m, iter, &p->page_url) && |
| 586 ReadParam(m, iter, &p->frame_url); |
| 587 } |
| 588 |
| 589 // static |
| 590 void ParamTraits<MiniContextMenuParams>::Log(const param_type& p, |
| 591 std::string* l) { |
| 592 l->append("("); |
| 593 LogParam(p.screen_x, l); |
| 594 l->append(", "); |
| 595 LogParam(p.screen_y, l); |
| 596 l->append(", "); |
| 597 LogParam(p.link_url, l); |
| 598 l->append(", "); |
| 599 LogParam(p.unfiltered_link_url, l); |
| 600 l->append(", "); |
| 601 LogParam(p.src_url, l); |
| 602 l->append(", "); |
| 603 LogParam(p.page_url, l); |
| 604 l->append(", "); |
| 605 LogParam(p.frame_url, l); |
| 606 l->append(")"); |
| 607 } |
| 608 |
| 609 AttachExternalTabParams::AttachExternalTabParams() |
| 610 : cookie(0), |
| 611 disposition(0), |
| 612 user_gesture(false) { |
| 613 } |
| 614 |
| 615 AttachExternalTabParams::AttachExternalTabParams( |
| 616 uint64 in_cookie, |
| 617 const GURL& in_url, |
| 618 const gfx::Rect& in_dimensions, |
| 619 int in_disposition, |
| 620 bool in_user_gesture, |
| 621 const std::string& in_profile_name) |
| 622 : cookie(in_cookie), |
| 623 url(in_url), |
| 624 dimensions(in_dimensions), |
| 625 disposition(in_disposition), |
| 626 user_gesture(in_user_gesture), |
| 627 profile_name(in_profile_name) { |
| 628 } |
| 629 |
| 630 AttachExternalTabParams::~AttachExternalTabParams() {} |
| 631 |
| 632 // static |
| 633 void ParamTraits<AttachExternalTabParams>::Write(Message* m, |
| 634 const param_type& p) { |
| 635 WriteParam(m, p.cookie); |
| 636 WriteParam(m, p.url); |
| 637 WriteParam(m, p.dimensions); |
| 638 WriteParam(m, p.disposition); |
| 639 WriteParam(m, p.user_gesture); |
| 640 WriteParam(m, p.profile_name); |
| 641 } |
| 642 |
| 643 // static |
| 644 bool ParamTraits<AttachExternalTabParams>::Read(const Message* m, |
| 645 void** iter, |
| 646 param_type* p) { |
| 647 return ReadParam(m, iter, &p->cookie) && |
| 648 ReadParam(m, iter, &p->url) && |
| 649 ReadParam(m, iter, &p->dimensions) && |
| 650 ReadParam(m, iter, &p->disposition) && |
| 651 ReadParam(m, iter, &p->user_gesture) && |
| 652 ReadParam(m, iter, &p->profile_name); |
| 653 } |
| 654 |
| 655 // static |
| 656 void ParamTraits<AttachExternalTabParams>::Log(const param_type& p, |
| 657 std::string* l) { |
| 658 l->append("("); |
| 659 LogParam(p.cookie, l); |
| 660 l->append(", "); |
| 661 LogParam(p.url, l); |
| 662 l->append(", "); |
| 663 LogParam(p.dimensions, l); |
| 664 l->append(", "); |
| 665 LogParam(p.disposition, l); |
| 666 l->append(", "); |
| 667 LogParam(p.user_gesture, l); |
| 668 l->append(","); |
| 669 LogParam(p.profile_name, l); |
| 670 l->append(")"); |
| 671 } |
| 672 |
| 673 } // namespace IPC |
OLD | NEW |