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 #include "ppapi/proxy/resource_creation_proxy.h" | 5 #include "ppapi/proxy/resource_creation_proxy.h" |
6 | 6 |
7 #include "ppapi/c/pp_errors.h" | 7 #include "ppapi/c/pp_errors.h" |
8 #include "ppapi/c/pp_size.h" | 8 #include "ppapi/c/pp_size.h" |
9 #include "ppapi/c/trusted/ppb_image_data_trusted.h" | 9 #include "ppapi/c/trusted/ppb_image_data_trusted.h" |
10 #include "ppapi/proxy/plugin_dispatcher.h" | 10 #include "ppapi/proxy/plugin_dispatcher.h" |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
69 const char* path) { | 69 const char* path) { |
70 return PPB_FileRef_Proxy::CreateProxyResource(file_system, path); | 70 return PPB_FileRef_Proxy::CreateProxyResource(file_system, path); |
71 } | 71 } |
72 | 72 |
73 PP_Resource ResourceCreationProxy::CreateFileSystem( | 73 PP_Resource ResourceCreationProxy::CreateFileSystem( |
74 PP_Instance instance, | 74 PP_Instance instance, |
75 PP_FileSystemType type) { | 75 PP_FileSystemType type) { |
76 return PPB_FileSystem_Proxy::CreateProxyResource(instance, type); | 76 return PPB_FileSystem_Proxy::CreateProxyResource(instance, type); |
77 } | 77 } |
78 | 78 |
79 PP_Resource ResourceCreationProxy::CreateIMEInputEvent( | |
80 PP_Instance instance, | |
81 PP_InputEvent_Type type, | |
82 PP_TimeTicks time_stamp, | |
83 struct PP_Var text, | |
84 uint32_t segment_number, | |
85 const uint32_t* segment_offsets, | |
86 int32_t target_segment, | |
87 uint32_t selection_start, | |
88 uint32_t selection_end) { | |
89 if (type != PP_INPUTEVENT_TYPE_IME_COMPOSITION_START && | |
90 type != PP_INPUTEVENT_TYPE_IME_COMPOSITION_UPDATE && | |
91 type != PP_INPUTEVENT_TYPE_IME_COMPOSITION_END && | |
92 type != PP_INPUTEVENT_TYPE_IME_TEXT) | |
93 return 0; | |
94 | |
95 InputEventData data; | |
96 data.event_type = type; | |
97 data.event_time_stamp = time_stamp; | |
98 if (text.type == PP_VARTYPE_STRING) { | |
99 StringVar* text_str = StringVar::FromPPVar(text); | |
100 if (!text_str) | |
101 return 0; | |
102 data.character_text = text_str->value(); | |
103 } | |
104 data.composition_target_segment = target_segment; | |
105 if (segment_number != 0) { | |
106 data.composition_segment_offsets.assign(&segment_offsets[0], | |
107 &segment_offsets[segment_number+1]); | |
yzshen1
2012/05/15 18:03:48
spaces around '+', please.
kinaba
2012/05/16 10:13:57
Done.
| |
108 } | |
109 data.composition_selection_start = selection_start; | |
110 data.composition_selection_end = selection_end; | |
111 | |
112 return (new PPB_InputEvent_Shared(OBJECT_IS_PROXY, | |
113 instance, data))->GetReference(); | |
114 } | |
115 | |
79 PP_Resource ResourceCreationProxy::CreateKeyboardInputEvent( | 116 PP_Resource ResourceCreationProxy::CreateKeyboardInputEvent( |
80 PP_Instance instance, | 117 PP_Instance instance, |
81 PP_InputEvent_Type type, | 118 PP_InputEvent_Type type, |
82 PP_TimeTicks time_stamp, | 119 PP_TimeTicks time_stamp, |
83 uint32_t modifiers, | 120 uint32_t modifiers, |
84 uint32_t key_code, | 121 uint32_t key_code, |
85 struct PP_Var character_text) { | 122 struct PP_Var character_text) { |
86 if (type != PP_INPUTEVENT_TYPE_RAWKEYDOWN && | 123 if (type != PP_INPUTEVENT_TYPE_RAWKEYDOWN && |
87 type != PP_INPUTEVENT_TYPE_KEYDOWN && | 124 type != PP_INPUTEVENT_TYPE_KEYDOWN && |
88 type != PP_INPUTEVENT_TYPE_KEYUP && | 125 type != PP_INPUTEVENT_TYPE_KEYUP && |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
365 bool ResourceCreationProxy::Send(IPC::Message* msg) { | 402 bool ResourceCreationProxy::Send(IPC::Message* msg) { |
366 return dispatcher()->Send(msg); | 403 return dispatcher()->Send(msg); |
367 } | 404 } |
368 | 405 |
369 bool ResourceCreationProxy::OnMessageReceived(const IPC::Message& msg) { | 406 bool ResourceCreationProxy::OnMessageReceived(const IPC::Message& msg) { |
370 return false; | 407 return false; |
371 } | 408 } |
372 | 409 |
373 } // namespace proxy | 410 } // namespace proxy |
374 } // namespace ppapi | 411 } // namespace ppapi |
OLD | NEW |