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

Side by Side Diff: ppapi/thunk/ppb_ime_control_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
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/c/dev/ppb_ime_control_dev.h"
6 #include "ppapi/thunk/enter.h"
7 #include "ppapi/thunk/ppb_ime_control_api.h"
8 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h"
9 #include "webkit/plugins/ppapi/resource_tracker.h"
10
11 namespace ppapi {
12 namespace thunk {
13
14 namespace {
15
16 void SetTextInputType(PP_Instance instance, PP_TextInput_Type type) {
17 EnterFunction<PPB_IMEControl_FunctionAPI> enter(instance, true);
18 if (enter.succeeded())
19 enter.functions()->SetTextInputType(instance, type);
20 }
21
22 void UpdateCaretPosition(PP_Instance instance, PP_Rect caret,
23 PP_Rect boundingBox) {
24 EnterFunction<PPB_IMEControl_FunctionAPI> enter(instance, true);
25 if (enter.succeeded())
26 enter.functions()->UpdateCaretPosition(instance, caret, boundingBox);
27 }
28
29 void ConfirmCompositionText(PP_Instance instance) {
30 EnterFunction<PPB_IMEControl_FunctionAPI> enter(instance, true);
31 if (enter.succeeded())
32 enter.functions()->ConfirmCompositionText(instance);
33 }
34
35 void CancelCompositionText(PP_Instance instance) {
36 EnterFunction<PPB_IMEControl_FunctionAPI> enter(instance, true);
37 if (enter.succeeded())
38 enter.functions()->CancelCompositionText(instance);
39 }
40
41 const PPB_IMEControl_Dev g_ppb_imecontrol_thunk = {
42 &SetTextInputType,
43 &UpdateCaretPosition,
44 &ConfirmCompositionText,
45 &CancelCompositionText,
46 };
47
48 } // namespace
49
50 const PPB_IMEControl_Dev* GetPPB_IMEControl_Thunk() {
51 return &g_ppb_imecontrol_thunk;
52 }
53
54 } // namespace thunk
55 } // namespace ppapi
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698