OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_RENDER_MESSAGES_H_ | 5 #ifndef CHROME_COMMON_RENDER_MESSAGES_H_ |
6 #define CHROME_COMMON_RENDER_MESSAGES_H_ | 6 #define CHROME_COMMON_RENDER_MESSAGES_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
364 // Cookie for the document to ensure correctness. | 364 // Cookie for the document to ensure correctness. |
365 int document_cookie; | 365 int document_cookie; |
366 | 366 |
367 // Page number. | 367 // Page number. |
368 int page_number; | 368 int page_number; |
369 | 369 |
370 // Shrink factor used to render this page. | 370 // Shrink factor used to render this page. |
371 double actual_shrink; | 371 double actual_shrink; |
372 }; | 372 }; |
373 | 373 |
| 374 // Parameters structure to hold a union of the possible IAccessible function |
| 375 // INPUT variables, with the unused fields always set to default value. Used in |
| 376 // ViewMsg_GetAccessibilityInfo, as only parameter. |
| 377 struct ViewMsg_Accessibility_In_Params { |
| 378 // Identifier to uniquely distinguish which instance of IAccessible is being |
| 379 // called upon on the renderer side. |
| 380 int iaccessible_id; |
| 381 |
| 382 // Identifier to resolve which IAccessible interface function is being called. |
| 383 int iaccessible_function_id; |
| 384 |
| 385 // Function input parameters. |
| 386 // Input VARIANT structure's LONG field to specify requested object. |
| 387 long input_variant_lval; |
| 388 |
| 389 // LONG input parameters, used differently depending on the function called. |
| 390 long input_long1; |
| 391 long input_long2; |
| 392 }; |
| 393 |
| 394 // Parameters structure to hold a union of the possible IAccessible function |
| 395 // OUTPUT variables, with the unused fields always set to default value. Used in |
| 396 // ViewHostMsg_GetAccessibilityInfoResponse, as only parameter. |
| 397 struct ViewHostMsg_Accessibility_Out_Params { |
| 398 // Identifier to uniquely distinguish which instance of IAccessible is being |
| 399 // called upon on the renderer side. |
| 400 int iaccessible_id; |
| 401 |
| 402 // Function output parameters. |
| 403 // Output VARIANT structure's LONG field to specify requested object. |
| 404 long output_variant_lval; |
| 405 |
| 406 // LONG output parameters, used differently depending on the function called. |
| 407 // output_long1 can in some cases be set to -1 to indicate that the child |
| 408 // object found by the called IAccessible function is not a simple object. |
| 409 long output_long1; |
| 410 long output_long2; |
| 411 long output_long3; |
| 412 long output_long4; |
| 413 |
| 414 // String output parameter. |
| 415 std::wstring output_string; |
| 416 |
| 417 // Return code, either S_OK (true) or S_FALSE (false). WebKit MSAA error |
| 418 // return codes (E_POINTER, E_INVALIDARG, E_FAIL, E_NOTIMPL) must be handled |
| 419 // on the browser side by input validation. |
| 420 bool return_code; |
| 421 }; |
| 422 |
374 // The first parameter for the ViewHostMsg_ImeUpdateStatus message. | 423 // The first parameter for the ViewHostMsg_ImeUpdateStatus message. |
375 enum ViewHostMsg_ImeControl { | 424 enum ViewHostMsg_ImeControl { |
376 IME_DISABLE = 0, | 425 IME_DISABLE = 0, |
377 IME_MOVE_WINDOWS, | 426 IME_MOVE_WINDOWS, |
378 IME_COMPLETE_COMPOSITION, | 427 IME_COMPLETE_COMPOSITION, |
379 }; | 428 }; |
380 | 429 |
381 // Multi-pass include of render_messages_internal. Preprocessor magic allows | 430 // Multi-pass include of render_messages_internal. Preprocessor magic allows |
382 // us to use 1 header to define the enums and classes for our render messages. | 431 // us to use 1 header to define the enums and classes for our render messages. |
383 #define IPC_MESSAGE_MACROS_ENUMS | 432 #define IPC_MESSAGE_MACROS_ENUMS |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
568 break; | 617 break; |
569 default: | 618 default: |
570 event = L"UNKNOWN"; | 619 event = L"UNKNOWN"; |
571 break; | 620 break; |
572 } | 621 } |
573 | 622 |
574 LogParam(event, l); | 623 LogParam(event, l); |
575 } | 624 } |
576 }; | 625 }; |
577 | 626 |
| 627 // Traits for ViewMsg_Accessibility_In_Params structure to pack/unpack. |
| 628 template <> |
| 629 struct ParamTraits<ViewMsg_Accessibility_In_Params> { |
| 630 typedef ViewMsg_Accessibility_In_Params param_type; |
| 631 static void Write(Message* m, const param_type& p) { |
| 632 WriteParam(m, p.iaccessible_id); |
| 633 WriteParam(m, p.iaccessible_function_id); |
| 634 WriteParam(m, p.input_variant_lval); |
| 635 WriteParam(m, p.input_long1); |
| 636 WriteParam(m, p.input_long2); |
| 637 } |
| 638 static bool Read(const Message* m, void** iter, param_type* p) { |
| 639 return |
| 640 ReadParam(m, iter, &p->iaccessible_id) && |
| 641 ReadParam(m, iter, &p->iaccessible_function_id) && |
| 642 ReadParam(m, iter, &p->input_variant_lval) && |
| 643 ReadParam(m, iter, &p->input_long1) && |
| 644 ReadParam(m, iter, &p->input_long2); |
| 645 } |
| 646 static void Log(const param_type& p, std::wstring* l) { |
| 647 l->append(L"("); |
| 648 LogParam(p.iaccessible_id, l); |
| 649 l->append(L", "); |
| 650 LogParam(p.iaccessible_function_id, l); |
| 651 l->append(L", "); |
| 652 LogParam(p.input_variant_lval, l); |
| 653 l->append(L", "); |
| 654 LogParam(p.input_long1, l); |
| 655 l->append(L", "); |
| 656 LogParam(p.input_long2, l); |
| 657 l->append(L")"); |
| 658 } |
| 659 }; |
| 660 |
| 661 // Traits for ViewHostMsg_Accessibility_Out_Params structure to pack/unpack. |
| 662 template <> |
| 663 struct ParamTraits<ViewHostMsg_Accessibility_Out_Params> { |
| 664 typedef ViewHostMsg_Accessibility_Out_Params param_type; |
| 665 static void Write(Message* m, const param_type& p) { |
| 666 WriteParam(m, p.iaccessible_id); |
| 667 WriteParam(m, p.output_variant_lval); |
| 668 WriteParam(m, p.output_long1); |
| 669 WriteParam(m, p.output_long2); |
| 670 WriteParam(m, p.output_long3); |
| 671 WriteParam(m, p.output_long4); |
| 672 WriteParam(m, p.output_string); |
| 673 WriteParam(m, p.return_code); |
| 674 } |
| 675 static bool Read(const Message* m, void** iter, param_type* p) { |
| 676 return |
| 677 ReadParam(m, iter, &p->iaccessible_id) && |
| 678 ReadParam(m, iter, &p->output_variant_lval) && |
| 679 ReadParam(m, iter, &p->output_long1) && |
| 680 ReadParam(m, iter, &p->output_long2) && |
| 681 ReadParam(m, iter, &p->output_long3) && |
| 682 ReadParam(m, iter, &p->output_long4) && |
| 683 ReadParam(m, iter, &p->output_string) && |
| 684 ReadParam(m, iter, &p->return_code); |
| 685 } |
| 686 static void Log(const param_type& p, std::wstring* l) { |
| 687 l->append(L"("); |
| 688 LogParam(p.iaccessible_id, l); |
| 689 l->append(L", "); |
| 690 LogParam(p.output_variant_lval, l); |
| 691 l->append(L", "); |
| 692 LogParam(p.output_long1, l); |
| 693 l->append(L", "); |
| 694 LogParam(p.output_long2, l); |
| 695 l->append(L", "); |
| 696 LogParam(p.output_long3, l); |
| 697 l->append(L", "); |
| 698 LogParam(p.output_long4, l); |
| 699 l->append(L", "); |
| 700 LogParam(p.output_string, l); |
| 701 l->append(L", "); |
| 702 LogParam(p.return_code, l); |
| 703 l->append(L")"); |
| 704 } |
| 705 }; |
| 706 |
578 template <> | 707 template <> |
579 struct ParamTraits<ViewHostMsg_ImeControl> { | 708 struct ParamTraits<ViewHostMsg_ImeControl> { |
580 typedef ViewHostMsg_ImeControl param_type; | 709 typedef ViewHostMsg_ImeControl param_type; |
581 static void Write(Message* m, const param_type& p) { | 710 static void Write(Message* m, const param_type& p) { |
582 m->WriteInt(p); | 711 m->WriteInt(p); |
583 } | 712 } |
584 static bool Read(const Message* m, void** iter, param_type* p) { | 713 static bool Read(const Message* m, void** iter, param_type* p) { |
585 int type; | 714 int type; |
586 if (!m->ReadInt(iter, &type)) | 715 if (!m->ReadInt(iter, &type)) |
587 return false; | 716 return false; |
(...skipping 912 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1500 ReadParam(m, iter, &p->file_contents); | 1629 ReadParam(m, iter, &p->file_contents); |
1501 } | 1630 } |
1502 static void Log(const param_type& p, std::wstring* l) { | 1631 static void Log(const param_type& p, std::wstring* l) { |
1503 l->append(L"<WebDropData>"); | 1632 l->append(L"<WebDropData>"); |
1504 } | 1633 } |
1505 }; | 1634 }; |
1506 | 1635 |
1507 } // namespace IPC | 1636 } // namespace IPC |
1508 | 1637 |
1509 #endif // CHROME_COMMON_RENDER_MESSAGES_H_ | 1638 #endif // CHROME_COMMON_RENDER_MESSAGES_H_ |
OLD | NEW |