1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
|
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/common/common_param_traits.h"
#include "content/common/common_param_traits.h"
#include "webkit/glue/form_data.h"
#include "webkit/glue/form_field.h"
#include "webkit/glue/password_form.h"
#include "webkit/glue/password_form_dom_manager.h"
#define IPC_MESSAGE_IMPL
#include "chrome/common/autofill_messages.h"
namespace IPC {
void ParamTraits<webkit_glue::FormField>::Write(Message* m,
const param_type& p) {
WriteParam(m, p.label());
WriteParam(m, p.name());
WriteParam(m, p.value());
WriteParam(m, p.form_control_type());
WriteParam(m, p.max_length());
WriteParam(m, p.is_autofilled());
WriteParam(m, p.option_strings());
}
bool ParamTraits<webkit_glue::FormField>::Read(const Message* m, void** iter,
param_type* p) {
string16 label, name, value, form_control_type;
int max_length = 0;
bool is_autofilled;
std::vector<string16> options;
bool result = ReadParam(m, iter, &label);
result = result && ReadParam(m, iter, &name);
result = result && ReadParam(m, iter, &value);
result = result && ReadParam(m, iter, &form_control_type);
result = result && ReadParam(m, iter, &max_length);
result = result && ReadParam(m, iter, &is_autofilled);
result = result && ReadParam(m, iter, &options);
if (!result)
return false;
p->set_label(label);
p->set_name(name);
p->set_value(value);
p->set_form_control_type(form_control_type);
p->set_max_length(max_length);
p->set_autofilled(is_autofilled);
p->set_option_strings(options);
return true;
}
void ParamTraits<webkit_glue::FormField>::Log(const param_type& p,
std::string* l) {
l->append("<FormField>");
}
void ParamTraits<webkit_glue::FormData>::Write(Message* m,
const param_type& p) {
WriteParam(m, p.name);
WriteParam(m, p.method);
WriteParam(m, p.origin);
WriteParam(m, p.action);
WriteParam(m, p.user_submitted);
WriteParam(m, p.fields);
}
bool ParamTraits<webkit_glue::FormData>::Read(const Message* m, void** iter,
param_type* p) {
return
ReadParam(m, iter, &p->name) &&
ReadParam(m, iter, &p->method) &&
ReadParam(m, iter, &p->origin) &&
ReadParam(m, iter, &p->action) &&
ReadParam(m, iter, &p->user_submitted) &&
ReadParam(m, iter, &p->fields);
}
void ParamTraits<webkit_glue::FormData>::Log(const param_type& p,
std::string* l) {
l->append("<FormData>");
}
void ParamTraits<webkit_glue::PasswordFormFillData>::Write(
Message* m, const param_type& p) {
WriteParam(m, p.basic_data);
WriteParam(m, p.additional_logins);
WriteParam(m, p.wait_for_username);
}
bool ParamTraits<webkit_glue::PasswordFormFillData>::Read(
const Message* m, void** iter, param_type* r) {
return
ReadParam(m, iter, &r->basic_data) &&
ReadParam(m, iter, &r->additional_logins) &&
ReadParam(m, iter, &r->wait_for_username);
}
void ParamTraits<webkit_glue::PasswordFormFillData>::Log(const param_type& p,
std::string* l) {
l->append("<PasswordFormFillData>");
}
} // namespace IPC
|