Chromium Code Reviews| 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/cpp/input_event.h" | 5 #include "ppapi/cpp/input_event.h" |
| 6 | 6 |
| 7 #include "ppapi/cpp/instance.h" | 7 #include "ppapi/cpp/instance.h" |
| 8 #include "ppapi/cpp/module.h" | 8 #include "ppapi/cpp/module.h" |
| 9 #include "ppapi/cpp/module_impl.h" | 9 #include "ppapi/cpp/module_impl.h" |
| 10 #include "ppapi/cpp/point.h" | 10 #include "ppapi/cpp/point.h" |
| 11 #include "ppapi/cpp/var.h" | 11 #include "ppapi/cpp/var.h" |
| 12 | 12 |
| 13 namespace pp { | 13 namespace pp { |
| 14 | 14 |
| 15 namespace { | 15 namespace { |
| 16 | 16 |
| 17 template <> const char* interface_name<PPB_InputEvent>() { | 17 template <> const char* interface_name<PPB_InputEvent>() { |
| 18 return PPB_INPUT_EVENT_INTERFACE; | 18 return PPB_INPUT_EVENT_INTERFACE; |
| 19 } | 19 } |
| 20 | 20 |
| 21 template <> const char* interface_name<PPB_KeyboardInputEvent>() { | 21 template <> const char* interface_name<PPB_KeyboardInputEvent>() { |
| 22 return PPB_KEYBOARD_INPUT_EVENT_INTERFACE; | 22 return PPB_KEYBOARD_INPUT_EVENT_INTERFACE; |
| 23 } | 23 } |
| 24 | 24 |
| 25 template <> const char* interface_name<PPB_KeyboardInputEvent_Dev>() { | |
| 26 return PPB_KEYBOARD_INPUT_EVENT_DEV_INTERFACE; | |
|
Wez
2012/02/17 01:31:01
Nor this.
garykac
2012/02/17 18:25:30
Done.
| |
| 27 } | |
| 28 | |
| 25 template <> const char* interface_name<PPB_MouseInputEvent>() { | 29 template <> const char* interface_name<PPB_MouseInputEvent>() { |
| 26 return PPB_MOUSE_INPUT_EVENT_INTERFACE; | 30 return PPB_MOUSE_INPUT_EVENT_INTERFACE; |
| 27 } | 31 } |
| 28 | 32 |
| 29 template <> const char* interface_name<PPB_WheelInputEvent>() { | 33 template <> const char* interface_name<PPB_WheelInputEvent>() { |
| 30 return PPB_WHEEL_INPUT_EVENT_INTERFACE; | 34 return PPB_WHEEL_INPUT_EVENT_INTERFACE; |
| 31 } | 35 } |
| 32 | 36 |
| 33 } // namespace | 37 } // namespace |
| 34 | 38 |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 212 | 216 |
| 213 Var KeyboardInputEvent::GetCharacterText() const { | 217 Var KeyboardInputEvent::GetCharacterText() const { |
| 214 if (!has_interface<PPB_KeyboardInputEvent>()) | 218 if (!has_interface<PPB_KeyboardInputEvent>()) |
| 215 return Var(); | 219 return Var(); |
| 216 return Var(Var::PassRef(), | 220 return Var(Var::PassRef(), |
| 217 get_interface<PPB_KeyboardInputEvent>()->GetCharacterText( | 221 get_interface<PPB_KeyboardInputEvent>()->GetCharacterText( |
| 218 pp_resource())); | 222 pp_resource())); |
| 219 } | 223 } |
| 220 | 224 |
| 221 } // namespace pp | 225 } // namespace pp |
| OLD | NEW |