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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: ppapi/cpp/dev/text_input_dev.cc
diff --git a/ppapi/cpp/dev/text_input_dev.cc b/ppapi/cpp/dev/text_input_dev.cc
new file mode 100644
index 0000000000000000000000000000000000000000..3ead04010a707f1d1f7f475dec32d2bbda1e6203
--- /dev/null
+++ b/ppapi/cpp/dev/text_input_dev.cc
@@ -0,0 +1,57 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ppapi/cpp/dev/text_input_dev.h"
+
+#include "ppapi/cpp/instance.h"
+#include "ppapi/cpp/module_impl.h"
+#include "ppapi/cpp/rect.h"
+
+namespace pp {
+
+namespace {
+
+template <> const char* interface_name<PPB_TextInput_Dev>() {
+ return PPB_TEXTINPUT_DEV_INTERFACE;
+}
+
+} // namespace
+
+
+TextInput_Dev::TextInput_Dev(Instance* instance) : instance_(instance) {
+}
+
+TextInput_Dev::~TextInput_Dev() {
+}
+
+void TextInput_Dev::SetTextInputType(PP_TextInput_Type type) {
+ if (!has_interface<PPB_TextInput_Dev>())
+ return;
+ get_interface<PPB_TextInput_Dev>()->SetTextInputType(
+ instance_->pp_instance(), type);
+}
+
+void TextInput_Dev::UpdateCaretPosition(const Rect& caret,
+ const Rect& bounding_box) {
+ if (!has_interface<PPB_TextInput_Dev>())
+ return;
+ get_interface<PPB_TextInput_Dev>()->UpdateCaretPosition(
+ instance_->pp_instance(), &caret.pp_rect(), &bounding_box.pp_rect());
+}
+
+void TextInput_Dev::ConfirmCompositionText() {
+ if (!has_interface<PPB_TextInput_Dev>())
+ return;
+ get_interface<PPB_TextInput_Dev>()->ConfirmCompositionText(
+ instance_->pp_instance());
+}
+
+void TextInput_Dev::CancelCompositionText() {
+ if (!has_interface<PPB_TextInput_Dev>())
+ return;
+ get_interface<PPB_TextInput_Dev>()->CancelCompositionText(
+ instance_->pp_instance());
+}
+
+} // namespace pp

Powered by Google App Engine
This is Rietveld 408576698