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

Side by Side Diff: ppapi/cpp/dev/text_input_dev.cc

Issue 7882004: Declarations for Pepper IME API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Clarified the specification of GetSegmentAt(). 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/cpp/dev/text_input_dev.h"
6
7 #include "ppapi/cpp/instance.h"
8 #include "ppapi/cpp/module_impl.h"
9 #include "ppapi/cpp/rect.h"
10
11 namespace pp {
12
13 namespace {
14
15 template <> const char* interface_name<PPB_TextInput_Dev>() {
16 return PPB_TEXTINPUT_DEV_INTERFACE;
17 }
18
19 } // namespace
20
21
22 TextInput_Dev::TextInput_Dev(Instance* instance) : instance_(instance) {
23 }
24
25 TextInput_Dev::~TextInput_Dev() {
26 }
27
28 void TextInput_Dev::SetTextInputType(PP_TextInput_Type type) {
29 if (!has_interface<PPB_TextInput_Dev>())
30 return;
31 get_interface<PPB_TextInput_Dev>()->SetTextInputType(
32 instance_->pp_instance(), type);
33 }
34
35 void TextInput_Dev::UpdateCaretPosition(const Rect& caret,
36 const Rect& bounding_box) {
37 if (!has_interface<PPB_TextInput_Dev>())
38 return;
39 get_interface<PPB_TextInput_Dev>()->UpdateCaretPosition(
40 instance_->pp_instance(), &caret.pp_rect(), &bounding_box.pp_rect());
41 }
42
43 void TextInput_Dev::ConfirmCompositionText() {
44 if (!has_interface<PPB_TextInput_Dev>())
45 return;
46 get_interface<PPB_TextInput_Dev>()->ConfirmCompositionText(
47 instance_->pp_instance());
48 }
49
50 void TextInput_Dev::CancelCompositionText() {
51 if (!has_interface<PPB_TextInput_Dev>())
52 return;
53 get_interface<PPB_TextInput_Dev>()->CancelCompositionText(
54 instance_->pp_instance());
55 }
56
57 } // namespace pp
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698