| 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 "webkit/plugins/ppapi/resource_creation_impl.h" | 5 #include "webkit/plugins/ppapi/resource_creation_impl.h" |
| 6 | 6 |
| 7 #include "ppapi/c/pp_size.h" | 7 #include "ppapi/c/pp_size.h" |
| 8 #include "ppapi/shared_impl/input_event_impl.h" | 8 #include "ppapi/shared_impl/input_event_impl.h" |
| 9 #include "ppapi/shared_impl/var.h" | 9 #include "ppapi/shared_impl/var.h" |
| 10 #include "webkit/plugins/ppapi/common.h" | 10 #include "webkit/plugins/ppapi/common.h" |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 type != PP_INPUTEVENT_TYPE_KEYUP && | 190 type != PP_INPUTEVENT_TYPE_KEYUP && |
| 191 type != PP_INPUTEVENT_TYPE_CHAR) | 191 type != PP_INPUTEVENT_TYPE_CHAR) |
| 192 return 0; | 192 return 0; |
| 193 | 193 |
| 194 InputEventData data; | 194 InputEventData data; |
| 195 data.event_type = type; | 195 data.event_type = type; |
| 196 data.event_time_stamp = time_stamp; | 196 data.event_time_stamp = time_stamp; |
| 197 data.event_modifiers = modifiers; | 197 data.event_modifiers = modifiers; |
| 198 data.key_code = key_code; | 198 data.key_code = key_code; |
| 199 if (character_text.type == PP_VARTYPE_STRING) { | 199 if (character_text.type == PP_VARTYPE_STRING) { |
| 200 scoped_refptr<StringVar> string_var(StringVar::FromPPVar(character_text)); | 200 StringVar* string_var = StringVar::FromPPVar(character_text); |
| 201 if (!string_var.get()) | 201 if (!string_var) |
| 202 return 0; | 202 return 0; |
| 203 data.character_text = string_var->value(); | 203 data.character_text = string_var->value(); |
| 204 } | 204 } |
| 205 | 205 |
| 206 return PPB_InputEvent_Impl::Create(instance_, data); | 206 return PPB_InputEvent_Impl::Create(instance_, data); |
| 207 } | 207 } |
| 208 | 208 |
| 209 PP_Resource ResourceCreationImpl::CreateMouseInputEvent( | 209 PP_Resource ResourceCreationImpl::CreateMouseInputEvent( |
| 210 PP_Instance instance, | 210 PP_Instance instance, |
| 211 PP_InputEvent_Type type, | 211 PP_InputEvent_Type type, |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 data.event_modifiers = modifiers; | 291 data.event_modifiers = modifiers; |
| 292 data.wheel_delta = *wheel_delta; | 292 data.wheel_delta = *wheel_delta; |
| 293 data.wheel_ticks = *wheel_ticks; | 293 data.wheel_ticks = *wheel_ticks; |
| 294 data.wheel_scroll_by_page = PP_ToBool(scroll_by_page); | 294 data.wheel_scroll_by_page = PP_ToBool(scroll_by_page); |
| 295 | 295 |
| 296 return PPB_InputEvent_Impl::Create(instance_, data); | 296 return PPB_InputEvent_Impl::Create(instance_, data); |
| 297 } | 297 } |
| 298 | 298 |
| 299 } // namespace ppapi | 299 } // namespace ppapi |
| 300 } // namespace webkit | 300 } // namespace webkit |
| OLD | NEW |