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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
|
// 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 "ppapi/proxy/ppb_input_event_proxy.h"
#include "ppapi/c/ppb_audio_config.h"
#include "ppapi/proxy/plugin_dispatcher.h"
#include "ppapi/proxy/plugin_var_tracker.h"
#include "ppapi/proxy/ppapi_messages.h"
#include "ppapi/shared_impl/input_event_impl.h"
#include "ppapi/shared_impl/resource.h"
#include "ppapi/shared_impl/var.h"
#include "ppapi/thunk/thunk.h"
using ppapi::HostResource;
using ppapi::InputEventData;
using ppapi::InputEventImpl;
using ppapi::Resource;
using ppapi::thunk::PPB_InputEvent_API;
namespace pp {
namespace proxy {
// The implementation is actually in InputEventImpl.
class InputEvent : public Resource, public InputEventImpl {
public:
InputEvent(const HostResource& resource, const InputEventData& data);
virtual ~InputEvent();
// Resource overrides.
virtual PPB_InputEvent_API* AsPPB_InputEvent_API() OVERRIDE;
// InputEventImpl overrides.
virtual PP_Var StringToPPVar(const std::string& str) OVERRIDE;
private:
DISALLOW_COPY_AND_ASSIGN(InputEvent);
};
InputEvent::InputEvent(const HostResource& resource, const InputEventData& data)
: Resource(resource),
InputEventImpl(data) {
}
InputEvent::~InputEvent() {
}
PPB_InputEvent_API* InputEvent::AsPPB_InputEvent_API() {
return this;
}
PP_Var InputEvent::StringToPPVar(const std::string& str) {
return ppapi::StringVar::StringToPPVar(0, str);
}
namespace {
InterfaceProxy* CreateInputEventProxy(Dispatcher* dispatcher,
const void* target_interface) {
return new PPB_InputEvent_Proxy(dispatcher, target_interface);
}
} // namespace
PPB_InputEvent_Proxy::PPB_InputEvent_Proxy(Dispatcher* dispatcher,
const void* target_interface)
: InterfaceProxy(dispatcher, target_interface) {
}
PPB_InputEvent_Proxy::~PPB_InputEvent_Proxy() {
}
// static
const InterfaceProxy::Info* PPB_InputEvent_Proxy::GetInputEventInfo() {
static const Info info = {
::ppapi::thunk::GetPPB_InputEvent_Thunk(),
PPB_INPUT_EVENT_INTERFACE,
INTERFACE_ID_NONE,
false,
&CreateInputEventProxy,
};
return &info;
}
// static
const InterfaceProxy::Info* PPB_InputEvent_Proxy::GetKeyboardInputEventInfo() {
static const Info info = {
::ppapi::thunk::GetPPB_KeyboardInputEvent_Thunk(),
PPB_KEYBOARD_INPUT_EVENT_INTERFACE,
INTERFACE_ID_NONE,
false,
&CreateInputEventProxy,
};
return &info;
}
// static
const InterfaceProxy::Info* PPB_InputEvent_Proxy::GetMouseInputEventInfo() {
static const Info info = {
::ppapi::thunk::GetPPB_MouseInputEvent_Thunk(),
PPB_MOUSE_INPUT_EVENT_INTERFACE,
INTERFACE_ID_NONE,
false,
&CreateInputEventProxy,
};
return &info;
}
// static
const InterfaceProxy::Info* PPB_InputEvent_Proxy::GetWheelInputEventInfo() {
static const Info info = {
::ppapi::thunk::GetPPB_WheelInputEvent_Thunk(),
PPB_WHEEL_INPUT_EVENT_INTERFACE,
INTERFACE_ID_NONE,
false,
&CreateInputEventProxy,
};
return &info;
}
// static
PP_Resource PPB_InputEvent_Proxy::CreateProxyResource(
PP_Instance instance,
const InputEventData& data) {
return (new InputEvent(HostResource::MakeInstanceOnly(instance), data))->
GetReference();
}
bool PPB_InputEvent_Proxy::OnMessageReceived(const IPC::Message& msg) {
// There are no IPC messages for this interface.
NOTREACHED();
return false;
}
} // namespace proxy
} // namespace pp
|