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

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

Issue 7977017: Never submit: tentative Pepper IME. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
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
8 namespace ppapi {
9 namespace thunk {
10
11 namespace {
12
13 void SetTextInputType(PP_Instance instance, PP_TextInput_Type type) {
14 EnterFunction<PPB_TextInput_FunctionAPI> enter(instance, true);
15 if (enter.succeeded())
16 enter.functions()->SetTextInputType(instance, type);
17 }
18
19 void UpdateCaretPosition(PP_Instance instance,
20 const PP_Rect* caret,
21 const PP_Rect* boundingBox) {
22 EnterFunction<PPB_TextInput_FunctionAPI> enter(instance, true);
23 if (enter.succeeded() && caret && boundingBox)
24 enter.functions()->UpdateCaretPosition(instance, *caret, *boundingBox);
25 }
26
27 void ConfirmCompositionText(PP_Instance instance) {
28 EnterFunction<PPB_TextInput_FunctionAPI> enter(instance, true);
29 if (enter.succeeded())
30 enter.functions()->ConfirmCompositionText(instance);
31 }
32
33 void CancelCompositionText(PP_Instance instance) {
34 EnterFunction<PPB_TextInput_FunctionAPI> enter(instance, true);
35 if (enter.succeeded())
36 enter.functions()->CancelCompositionText(instance);
37 }
38
39 const PPB_TextInput_Dev g_ppb_textinput_thunk = {
40 &SetTextInputType,
41 &UpdateCaretPosition,
42 &ConfirmCompositionText,
43 &CancelCompositionText,
44 };
45
46 } // namespace
47
48 const PPB_TextInput_Dev* GetPPB_TextInput_Dev_Thunk() {
49 return &g_ppb_textinput_thunk;
50 }
51
52 } // namespace thunk
53 } // namespace ppapi
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698