| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef PPAPI_SHARED_IMPL_PPB_INPUT_EVENT_SHARED_H_ | 5 #ifndef PPAPI_SHARED_IMPL_PPB_INPUT_EVENT_SHARED_H_ |
| 6 #define PPAPI_SHARED_IMPL_PPB_INPUT_EVENT_SHARED_H_ | 6 #define PPAPI_SHARED_IMPL_PPB_INPUT_EVENT_SHARED_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #include "ppapi/c/ppb_input_event.h" | 13 #include "ppapi/c/ppb_input_event.h" |
| 14 #include "ppapi/shared_impl/resource.h" | 14 #include "ppapi/shared_impl/resource.h" |
| 15 #include "ppapi/thunk/ppb_input_event_api.h" | 15 #include "ppapi/thunk/ppb_input_event_api.h" |
| 16 #include "ui/events/latency_info.h" |
| 16 | 17 |
| 17 namespace ppapi { | 18 namespace ppapi { |
| 18 | 19 |
| 19 // IF YOU ADD STUFF TO THIS CLASS | 20 // IF YOU ADD STUFF TO THIS CLASS |
| 20 // ============================== | 21 // ============================== |
| 21 // Be sure to add it to the STRUCT_TRAITS at the top of ppapi_messages.h | 22 // Be sure to add it to the STRUCT_TRAITS at the top of ppapi_messages.h |
| 22 struct PPAPI_SHARED_EXPORT InputEventData { | 23 struct PPAPI_SHARED_EXPORT InputEventData { |
| 23 InputEventData(); | 24 InputEventData(); |
| 24 ~InputEventData(); | 25 ~InputEventData(); |
| 25 | 26 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 49 std::string character_text; | 50 std::string character_text; |
| 50 | 51 |
| 51 std::vector<uint32_t> composition_segment_offsets; | 52 std::vector<uint32_t> composition_segment_offsets; |
| 52 int32_t composition_target_segment; | 53 int32_t composition_target_segment; |
| 53 uint32_t composition_selection_start; | 54 uint32_t composition_selection_start; |
| 54 uint32_t composition_selection_end; | 55 uint32_t composition_selection_end; |
| 55 | 56 |
| 56 std::vector<PP_TouchPoint> touches; | 57 std::vector<PP_TouchPoint> touches; |
| 57 std::vector<PP_TouchPoint> changed_touches; | 58 std::vector<PP_TouchPoint> changed_touches; |
| 58 std::vector<PP_TouchPoint> target_touches; | 59 std::vector<PP_TouchPoint> target_touches; |
| 60 |
| 61 ui::LatencyInfo latency_info; |
| 59 }; | 62 }; |
| 60 | 63 |
| 61 // This simple class implements the PPB_InputEvent_API in terms of the | 64 // This simple class implements the PPB_InputEvent_API in terms of the |
| 62 // shared InputEventData structure | 65 // shared InputEventData structure |
| 63 class PPAPI_SHARED_EXPORT PPB_InputEvent_Shared | 66 class PPAPI_SHARED_EXPORT PPB_InputEvent_Shared |
| 64 : public Resource, | 67 : public Resource, |
| 65 public thunk::PPB_InputEvent_API { | 68 public thunk::PPB_InputEvent_API { |
| 66 public: | 69 public: |
| 67 PPB_InputEvent_Shared(ResourceObjectType type, | 70 PPB_InputEvent_Shared(ResourceObjectType type, |
| 68 PP_Instance instance, | 71 PP_Instance instance, |
| (...skipping 21 matching lines...) Expand all Loading... |
| 90 virtual uint32_t GetIMESegmentOffset(uint32_t index) OVERRIDE; | 93 virtual uint32_t GetIMESegmentOffset(uint32_t index) OVERRIDE; |
| 91 virtual int32_t GetIMETargetSegment() OVERRIDE; | 94 virtual int32_t GetIMETargetSegment() OVERRIDE; |
| 92 virtual void GetIMESelection(uint32_t* start, uint32_t* end) OVERRIDE; | 95 virtual void GetIMESelection(uint32_t* start, uint32_t* end) OVERRIDE; |
| 93 virtual void AddTouchPoint(PP_TouchListType list, | 96 virtual void AddTouchPoint(PP_TouchListType list, |
| 94 const PP_TouchPoint& point) OVERRIDE; | 97 const PP_TouchPoint& point) OVERRIDE; |
| 95 virtual uint32_t GetTouchCount(PP_TouchListType list) OVERRIDE; | 98 virtual uint32_t GetTouchCount(PP_TouchListType list) OVERRIDE; |
| 96 virtual PP_TouchPoint GetTouchByIndex(PP_TouchListType list, | 99 virtual PP_TouchPoint GetTouchByIndex(PP_TouchListType list, |
| 97 uint32_t index) OVERRIDE; | 100 uint32_t index) OVERRIDE; |
| 98 virtual PP_TouchPoint GetTouchById(PP_TouchListType list, | 101 virtual PP_TouchPoint GetTouchById(PP_TouchListType list, |
| 99 uint32_t id) OVERRIDE; | 102 uint32_t id) OVERRIDE; |
| 103 virtual void TraceInputLatency(PP_Bool has_damage) OVERRIDE; |
| 100 | 104 |
| 101 // Implementations for event creation. | 105 // Implementations for event creation. |
| 102 static PP_Resource CreateIMEInputEvent(ResourceObjectType type, | 106 static PP_Resource CreateIMEInputEvent(ResourceObjectType type, |
| 103 PP_Instance instance, | 107 PP_Instance instance, |
| 104 PP_InputEvent_Type event_type, | 108 PP_InputEvent_Type event_type, |
| 105 PP_TimeTicks time_stamp, | 109 PP_TimeTicks time_stamp, |
| 106 struct PP_Var text, | 110 struct PP_Var text, |
| 107 uint32_t segment_number, | 111 uint32_t segment_number, |
| 108 const uint32_t* segment_offsets, | 112 const uint32_t* segment_offsets, |
| 109 int32_t target_segment, | 113 int32_t target_segment, |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 | 146 |
| 143 private: | 147 private: |
| 144 InputEventData data_; | 148 InputEventData data_; |
| 145 | 149 |
| 146 DISALLOW_IMPLICIT_CONSTRUCTORS(PPB_InputEvent_Shared); | 150 DISALLOW_IMPLICIT_CONSTRUCTORS(PPB_InputEvent_Shared); |
| 147 }; | 151 }; |
| 148 | 152 |
| 149 } // namespace ppapi | 153 } // namespace ppapi |
| 150 | 154 |
| 151 #endif // PPAPI_SHARED_IMPL_PPB_INPUT_EVENT_SHARED_H_ | 155 #endif // PPAPI_SHARED_IMPL_PPB_INPUT_EVENT_SHARED_H_ |
| OLD | NEW |