OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "ppapi/proxy/ppb_input_event_proxy.h" | 5 #include "ppapi/proxy/ppb_input_event_proxy.h" |
6 | 6 |
7 #include "ppapi/c/ppb_audio_config.h" | 7 #include "ppapi/c/ppb_audio_config.h" |
8 #include "ppapi/proxy/plugin_dispatcher.h" | 8 #include "ppapi/proxy/plugin_dispatcher.h" |
9 #include "ppapi/proxy/plugin_resource.h" | 9 #include "ppapi/proxy/plugin_resource.h" |
10 #include "ppapi/proxy/plugin_var_tracker.h" | 10 #include "ppapi/proxy/plugin_var_tracker.h" |
11 #include "ppapi/proxy/ppapi_messages.h" | 11 #include "ppapi/proxy/ppapi_messages.h" |
12 #include "ppapi/shared_impl/input_event_impl.h" | 12 #include "ppapi/shared_impl/input_event_impl.h" |
| 13 #include "ppapi/shared_impl/var.h" |
13 #include "ppapi/thunk/thunk.h" | 14 #include "ppapi/thunk/thunk.h" |
14 | 15 |
15 using ppapi::InputEventData; | 16 using ppapi::InputEventData; |
16 using ppapi::InputEventImpl; | 17 using ppapi::InputEventImpl; |
17 using ppapi::thunk::PPB_InputEvent_API; | 18 using ppapi::thunk::PPB_InputEvent_API; |
18 | 19 |
19 namespace pp { | 20 namespace pp { |
20 namespace proxy { | 21 namespace proxy { |
21 | 22 |
22 // The implementation is actually in InputEventImpl. | 23 // The implementation is actually in InputEventImpl. |
(...skipping 18 matching lines...) Expand all Loading... |
41 } | 42 } |
42 | 43 |
43 InputEvent::~InputEvent() { | 44 InputEvent::~InputEvent() { |
44 } | 45 } |
45 | 46 |
46 PPB_InputEvent_API* InputEvent::AsPPB_InputEvent_API() { | 47 PPB_InputEvent_API* InputEvent::AsPPB_InputEvent_API() { |
47 return this; | 48 return this; |
48 } | 49 } |
49 | 50 |
50 PP_Var InputEvent::StringToPPVar(const std::string& str) { | 51 PP_Var InputEvent::StringToPPVar(const std::string& str) { |
51 PP_Var ret; | 52 return ppapi::StringVar::StringToPPVar(0, str); |
52 ret.type = PP_VARTYPE_STRING; | |
53 ret.value.as_id = PluginVarTracker::GetInstance()->MakeString(str); | |
54 return ret; | |
55 } | 53 } |
56 | 54 |
57 namespace { | 55 namespace { |
58 | 56 |
59 InterfaceProxy* CreateInputEventProxy(Dispatcher* dispatcher, | 57 InterfaceProxy* CreateInputEventProxy(Dispatcher* dispatcher, |
60 const void* target_interface) { | 58 const void* target_interface) { |
61 return new PPB_InputEvent_Proxy(dispatcher, target_interface); | 59 return new PPB_InputEvent_Proxy(dispatcher, target_interface); |
62 } | 60 } |
63 | 61 |
64 } // namespace | 62 } // namespace |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 } | 127 } |
130 | 128 |
131 bool PPB_InputEvent_Proxy::OnMessageReceived(const IPC::Message& msg) { | 129 bool PPB_InputEvent_Proxy::OnMessageReceived(const IPC::Message& msg) { |
132 // There are no IPC messages for this interface. | 130 // There are no IPC messages for this interface. |
133 NOTREACHED(); | 131 NOTREACHED(); |
134 return false; | 132 return false; |
135 } | 133 } |
136 | 134 |
137 } // namespace proxy | 135 } // namespace proxy |
138 } // namespace pp | 136 } // namespace pp |
OLD | NEW |