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 #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 <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
704 default: | 704 default: |
705 type = L"UNKNOWN"; | 705 type = L"UNKNOWN"; |
706 break; | 706 break; |
707 } | 707 } |
708 | 708 |
709 LogParam(type, l); | 709 LogParam(type, l); |
710 } | 710 } |
711 }; | 711 }; |
712 | 712 |
713 template <> | 713 template <> |
| 714 struct ParamTraits<webkit_glue::WebAccessibility::InParams> { |
| 715 typedef webkit_glue::WebAccessibility::InParams param_type; |
| 716 static void Write(Message* m, const param_type& p) { |
| 717 WriteParam(m, p.object_id); |
| 718 WriteParam(m, p.function_id); |
| 719 WriteParam(m, p.child_id); |
| 720 WriteParam(m, p.input_long1); |
| 721 WriteParam(m, p.input_long2); |
| 722 } |
| 723 static bool Read(const Message* m, void** iter, param_type* p) { |
| 724 return |
| 725 ReadParam(m, iter, &p->object_id) && |
| 726 ReadParam(m, iter, &p->function_id) && |
| 727 ReadParam(m, iter, &p->child_id) && |
| 728 ReadParam(m, iter, &p->input_long1) && |
| 729 ReadParam(m, iter, &p->input_long2); |
| 730 } |
| 731 static void Log(const param_type& p, std::wstring* l) { |
| 732 l->append(L"("); |
| 733 LogParam(p.object_id, l); |
| 734 l->append(L", "); |
| 735 LogParam(p.function_id, l); |
| 736 l->append(L", "); |
| 737 LogParam(p.child_id, l); |
| 738 l->append(L", "); |
| 739 LogParam(p.input_long1, l); |
| 740 l->append(L", "); |
| 741 LogParam(p.input_long2, l); |
| 742 l->append(L")"); |
| 743 } |
| 744 }; |
| 745 |
| 746 template <> |
| 747 struct ParamTraits<webkit_glue::WebAccessibility::OutParams> { |
| 748 typedef webkit_glue::WebAccessibility::OutParams param_type; |
| 749 static void Write(Message* m, const param_type& p) { |
| 750 WriteParam(m, p.object_id); |
| 751 WriteParam(m, p.output_long1); |
| 752 WriteParam(m, p.output_long2); |
| 753 WriteParam(m, p.output_long3); |
| 754 WriteParam(m, p.output_long4); |
| 755 WriteParam(m, p.output_string); |
| 756 WriteParam(m, p.return_code); |
| 757 } |
| 758 static bool Read(const Message* m, void** iter, param_type* p) { |
| 759 return |
| 760 ReadParam(m, iter, &p->object_id) && |
| 761 ReadParam(m, iter, &p->output_long1) && |
| 762 ReadParam(m, iter, &p->output_long2) && |
| 763 ReadParam(m, iter, &p->output_long3) && |
| 764 ReadParam(m, iter, &p->output_long4) && |
| 765 ReadParam(m, iter, &p->output_string) && |
| 766 ReadParam(m, iter, &p->return_code); |
| 767 } |
| 768 static void Log(const param_type& p, std::wstring* l) { |
| 769 l->append(L"("); |
| 770 LogParam(p.object_id, l); |
| 771 l->append(L", "); |
| 772 LogParam(p.output_long1, l); |
| 773 l->append(L", "); |
| 774 LogParam(p.output_long2, l); |
| 775 l->append(L", "); |
| 776 LogParam(p.output_long3, l); |
| 777 l->append(L", "); |
| 778 LogParam(p.output_long4, l); |
| 779 l->append(L", "); |
| 780 LogParam(p.output_string, l); |
| 781 l->append(L", "); |
| 782 LogParam(p.return_code, l); |
| 783 l->append(L")"); |
| 784 } |
| 785 }; |
| 786 |
| 787 template <> |
714 struct ParamTraits<ViewHostMsg_ImeControl> { | 788 struct ParamTraits<ViewHostMsg_ImeControl> { |
715 typedef ViewHostMsg_ImeControl param_type; | 789 typedef ViewHostMsg_ImeControl param_type; |
716 static void Write(Message* m, const param_type& p) { | 790 static void Write(Message* m, const param_type& p) { |
717 m->WriteInt(p); | 791 m->WriteInt(p); |
718 } | 792 } |
719 static bool Read(const Message* m, void** iter, param_type* p) { | 793 static bool Read(const Message* m, void** iter, param_type* p) { |
720 int type; | 794 int type; |
721 if (!m->ReadInt(iter, &type)) | 795 if (!m->ReadInt(iter, &type)) |
722 return false; | 796 return false; |
723 *p = static_cast<ViewHostMsg_ImeControl>(type); | 797 *p = static_cast<ViewHostMsg_ImeControl>(type); |
(...skipping 1863 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2587 val >= WINDOW_CONTAINER_TYPE_MAX_VALUE) | 2661 val >= WINDOW_CONTAINER_TYPE_MAX_VALUE) |
2588 return false; | 2662 return false; |
2589 *p = static_cast<param_type>(val); | 2663 *p = static_cast<param_type>(val); |
2590 return true; | 2664 return true; |
2591 } | 2665 } |
2592 static void Log(const param_type& p, std::wstring* l) { | 2666 static void Log(const param_type& p, std::wstring* l) { |
2593 LogParam(p, l); | 2667 LogParam(p, l); |
2594 } | 2668 } |
2595 }; | 2669 }; |
2596 | 2670 |
2597 template <> | |
2598 struct ParamTraits<webkit_glue::WebAccessibility> { | |
2599 typedef webkit_glue::WebAccessibility param_type; | |
2600 static void Write(Message* m, const param_type& p) { | |
2601 WriteParam(m, p.id); | |
2602 WriteParam(m, p.name); | |
2603 WriteParam(m, p.value); | |
2604 WriteParam(m, p.action); | |
2605 WriteParam(m, p.description); | |
2606 WriteParam(m, p.help); | |
2607 WriteParam(m, p.shortcut); | |
2608 WriteParam(m, static_cast<int>(p.role)); | |
2609 WriteParam(m, static_cast<int>(p.state)); | |
2610 WriteParam(m, p.location); | |
2611 WriteParam(m, p.children); | |
2612 } | |
2613 static bool Read(const Message* m, void** iter, param_type* p) { | |
2614 bool ret = ReadParam(m, iter, &p->id); | |
2615 ret = ret && ReadParam(m, iter, &p->name); | |
2616 ret = ret && ReadParam(m, iter, &p->value); | |
2617 ret = ret && ReadParam(m, iter, &p->action); | |
2618 ret = ret && ReadParam(m, iter, &p->description); | |
2619 ret = ret && ReadParam(m, iter, &p->help); | |
2620 ret = ret && ReadParam(m, iter, &p->shortcut); | |
2621 int role = -1; | |
2622 ret = ret && ReadParam(m, iter, &role); | |
2623 if (role >= webkit_glue::WebAccessibility::ROLE_NONE && | |
2624 role < webkit_glue::WebAccessibility::NUM_ROLES) { | |
2625 p->role = static_cast<webkit_glue::WebAccessibility::Role>(role); | |
2626 } else { | |
2627 p->role = webkit_glue::WebAccessibility::ROLE_NONE; | |
2628 } | |
2629 int state = 0; | |
2630 ret = ret && ReadParam(m, iter, &state); | |
2631 p->state = static_cast<webkit_glue::WebAccessibility::State>(state); | |
2632 ret = ret && ReadParam(m, iter, &p->location); | |
2633 ret = ret && ReadParam(m, iter, &p->children); | |
2634 return ret; | |
2635 } | |
2636 static void Log(const param_type& p, std::wstring* l) { | |
2637 l->append(L"("); | |
2638 LogParam(p.id, l); | |
2639 l->append(L", "); | |
2640 LogParam(p.name, l); | |
2641 l->append(L", "); | |
2642 LogParam(p.value, l); | |
2643 l->append(L", "); | |
2644 LogParam(p.action, l); | |
2645 l->append(L", "); | |
2646 LogParam(p.description, l); | |
2647 l->append(L", "); | |
2648 LogParam(p.help, l); | |
2649 l->append(L", "); | |
2650 LogParam(p.shortcut, l); | |
2651 l->append(L", "); | |
2652 LogParam(static_cast<int>(p.role), l); | |
2653 l->append(L", "); | |
2654 LogParam(static_cast<int>(p.state), l); | |
2655 l->append(L", "); | |
2656 LogParam(p.location, l); | |
2657 l->append(L", "); | |
2658 LogParam(p.children, l); | |
2659 l->append(L")"); | |
2660 } | |
2661 }; | |
2662 | |
2663 } // namespace IPC | 2671 } // namespace IPC |
2664 | 2672 |
| 2673 |
2665 #define MESSAGES_INTERNAL_FILE "chrome/common/render_messages_internal.h" | 2674 #define MESSAGES_INTERNAL_FILE "chrome/common/render_messages_internal.h" |
2666 #include "ipc/ipc_message_macros.h" | 2675 #include "ipc/ipc_message_macros.h" |
2667 | 2676 |
2668 #endif // CHROME_COMMON_RENDER_MESSAGES_H_ | 2677 #endif // CHROME_COMMON_RENDER_MESSAGES_H_ |
OLD | NEW |