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 #include "chrome/common/render_messages.h" | 5 #include "chrome/common/render_messages.h" |
6 | 6 |
7 #include "chrome/common/thumbnail_score.h" | 7 #include "chrome/common/thumbnail_score.h" |
8 #include "third_party/WebKit/WebKit/chromium/public/WebCompositionUnderline.h" | |
9 #include "third_party/WebKit/WebKit/chromium/public/WebFindOptions.h" | |
10 #include "third_party/WebKit/WebKit/chromium/public/WebScreenInfo.h" | |
11 #include "webkit/glue/webaccessibility.h" | |
12 #include "webkit/glue/webcursor.h" | 8 #include "webkit/glue/webcursor.h" |
13 | 9 |
14 #define MESSAGES_INTERNAL_IMPL_FILE \ | 10 #define MESSAGES_INTERNAL_IMPL_FILE \ |
15 "chrome/common/render_messages_internal.h" | 11 "chrome/common/render_messages_internal.h" |
16 #include "ipc/ipc_message_impl_macros.h" | 12 #include "ipc/ipc_message_impl_macros.h" |
17 | |
18 namespace IPC { | |
19 | |
20 void ParamTraits<webkit_glue::WebAccessibility>::Write(Message* m, | |
21 const param_type& p) { | |
22 WriteParam(m, p.id); | |
23 WriteParam(m, p.name); | |
24 WriteParam(m, p.value); | |
25 WriteParam(m, static_cast<int>(p.role)); | |
26 WriteParam(m, static_cast<int>(p.state)); | |
27 WriteParam(m, p.location); | |
28 WriteParam(m, p.attributes); | |
29 WriteParam(m, p.children); | |
30 } | |
31 | |
32 bool ParamTraits<webkit_glue::WebAccessibility>::Read( | |
33 const Message* m, void** iter, param_type* p) { | |
34 bool ret = ReadParam(m, iter, &p->id); | |
35 ret = ret && ReadParam(m, iter, &p->name); | |
36 ret = ret && ReadParam(m, iter, &p->value); | |
37 int role = -1; | |
38 ret = ret && ReadParam(m, iter, &role); | |
39 if (role >= webkit_glue::WebAccessibility::ROLE_NONE && | |
40 role < webkit_glue::WebAccessibility::NUM_ROLES) { | |
41 p->role = static_cast<webkit_glue::WebAccessibility::Role>(role); | |
42 } else { | |
43 p->role = webkit_glue::WebAccessibility::ROLE_NONE; | |
44 } | |
45 int state = 0; | |
46 ret = ret && ReadParam(m, iter, &state); | |
47 p->state = static_cast<webkit_glue::WebAccessibility::State>(state); | |
48 ret = ret && ReadParam(m, iter, &p->location); | |
49 ret = ret && ReadParam(m, iter, &p->attributes); | |
50 ret = ret && ReadParam(m, iter, &p->children); | |
51 return ret; | |
52 } | |
53 | |
54 void ParamTraits<webkit_glue::WebAccessibility>::Log(const param_type& p, | |
55 std::wstring* l) { | |
56 l->append(L"("); | |
57 LogParam(p.id, l); | |
58 l->append(L", "); | |
59 LogParam(p.name, l); | |
60 l->append(L", "); | |
61 LogParam(p.value, l); | |
62 l->append(L", "); | |
63 LogParam(static_cast<int>(p.role), l); | |
64 l->append(L", "); | |
65 LogParam(static_cast<int>(p.state), l); | |
66 l->append(L", "); | |
67 LogParam(p.location, l); | |
68 l->append(L", "); | |
69 LogParam(p.attributes, l); | |
70 l->append(L", "); | |
71 LogParam(p.children, l); | |
72 l->append(L")"); | |
73 } | |
74 | |
75 } // namespace IPC | |
OLD | NEW |