Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(124)

Side by Side Diff: ppapi/thunk/ppb_text_input_thunk.cc

Issue 8769003: Pepper IME API for surrounding text retrieval. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge master. Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ppapi/thunk/ppb_text_input_api.h ('k') | webkit/plugins/ppapi/DEPS » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/thunk/enter.h" 5 #include "ppapi/thunk/enter.h"
6 #include "ppapi/thunk/thunk.h" 6 #include "ppapi/thunk/thunk.h"
7 #include "ppapi/thunk/ppb_text_input_api.h" 7 #include "ppapi/thunk/ppb_text_input_api.h"
8 8
9 namespace ppapi { 9 namespace ppapi {
10 namespace thunk { 10 namespace thunk {
(...skipping 13 matching lines...) Expand all
24 if (enter.succeeded() && caret && bounding_box) 24 if (enter.succeeded() && caret && bounding_box)
25 enter.functions()->UpdateCaretPosition(instance, *caret, *bounding_box); 25 enter.functions()->UpdateCaretPosition(instance, *caret, *bounding_box);
26 } 26 }
27 27
28 void CancelCompositionText(PP_Instance instance) { 28 void CancelCompositionText(PP_Instance instance) {
29 EnterFunction<PPB_TextInput_FunctionAPI> enter(instance, true); 29 EnterFunction<PPB_TextInput_FunctionAPI> enter(instance, true);
30 if (enter.succeeded()) 30 if (enter.succeeded())
31 enter.functions()->CancelCompositionText(instance); 31 enter.functions()->CancelCompositionText(instance);
32 } 32 }
33 33
34 const PPB_TextInput_Dev g_ppb_textinput_thunk = { 34 void UpdateSurroundingText(PP_Instance instance, const char* text,
35 uint32_t caret, uint32_t anchor) {
36 EnterFunction<PPB_TextInput_FunctionAPI> enter(instance, true);
37 if (enter.succeeded())
38 enter.functions()->UpdateSurroundingText(instance, text, caret, anchor);
39 }
40
41 void SelectionChanged(PP_Instance instance) {
42 EnterFunction<PPB_TextInput_FunctionAPI> enter(instance, true);
43 if (enter.succeeded())
44 enter.functions()->SelectionChanged(instance);
45 }
46
47 const PPB_TextInput_Dev_0_1 g_ppb_textinput_0_1_thunk = {
35 &SetTextInputType, 48 &SetTextInputType,
36 &UpdateCaretPosition, 49 &UpdateCaretPosition,
37 &CancelCompositionText, 50 &CancelCompositionText,
38 }; 51 };
39 52
53 const PPB_TextInput_Dev g_ppb_textinput_0_2_thunk = {
54 &SetTextInputType,
55 &UpdateCaretPosition,
56 &CancelCompositionText,
57 &UpdateSurroundingText,
58 &SelectionChanged,
59 };
60
40 } // namespace 61 } // namespace
41 62
42 const PPB_TextInput_Dev_0_1* GetPPB_TextInput_Dev_0_1_Thunk() { 63 const PPB_TextInput_Dev_0_1* GetPPB_TextInput_Dev_0_1_Thunk() {
43 return &g_ppb_textinput_thunk; 64 return &g_ppb_textinput_0_1_thunk;
65 }
66
67 const PPB_TextInput_Dev_0_2* GetPPB_TextInput_Dev_0_2_Thunk() {
68 return &g_ppb_textinput_0_2_thunk;
44 } 69 }
45 70
46 } // namespace thunk 71 } // namespace thunk
47 } // namespace ppapi 72 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/thunk/ppb_text_input_api.h ('k') | webkit/plugins/ppapi/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698