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

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

Issue 7621010: Never submit: tentative Pepper IME. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: snapshot. Created 9 years, 3 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') | ppapi/thunk/thunk.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "ppapi/thunk/enter.h"
6 #include "ppapi/thunk/ppb_text_input_api.h"
7 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h"
8 #include "webkit/plugins/ppapi/resource_tracker.h"
9
10 namespace ppapi {
11 namespace thunk {
12
13 namespace {
14
15 void SetTextInputType(PP_Instance instance, PP_TextInput_Type type) {
16 EnterFunction<PPB_TextInput_FunctionAPI> enter(instance, true);
17 if (enter.succeeded())
18 enter.functions()->SetTextInputType(instance, type);
19 }
20
21 void UpdateCaretPosition(PP_Instance instance,
22 const PP_Rect* caret,
23 const PP_Rect* boundingBox) {
24 EnterFunction<PPB_TextInput_FunctionAPI> enter(instance, true);
25 if (enter.succeeded() && caret && boundingBox)
26 enter.functions()->UpdateCaretPosition(instance, *caret, *boundingBox);
27 }
28
29 void ConfirmCompositionText(PP_Instance instance) {
30 EnterFunction<PPB_TextInput_FunctionAPI> enter(instance, true);
31 if (enter.succeeded())
32 enter.functions()->ConfirmCompositionText(instance);
33 }
34
35 void CancelCompositionText(PP_Instance instance) {
36 EnterFunction<PPB_TextInput_FunctionAPI> enter(instance, true);
37 if (enter.succeeded())
38 enter.functions()->CancelCompositionText(instance);
39 }
40
41 const PPB_TextInput_Dev g_ppb_textinput_thunk = {
42 &SetTextInputType,
43 &UpdateCaretPosition,
44 &ConfirmCompositionText,
45 &CancelCompositionText,
46 };
47
48 } // namespace
49
50 const PPB_TextInput_Dev* GetPPB_TextInput_Thunk() {
51 return &g_ppb_textinput_thunk;
52 }
53
54 } // namespace thunk
55 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/thunk/ppb_text_input_api.h ('k') | ppapi/thunk/thunk.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698