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

Unified Diff: ppapi/cpp/dev/text_input_dev.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ppapi/cpp/dev/text_input_dev.h ('k') | ppapi/cpp/input_event.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..633a1410113e952ebd0b22165182e16b4e3d2a7b
--- /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& boundingBox) {
+ if (!has_interface<PPB_TextInput_Dev>())
+ return;
+ get_interface<PPB_TextInput_Dev>()->UpdateCaretPosition(
+ instance_->pp_instance(), &caret.pp_rect(), &boundingBox.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
« no previous file with comments | « ppapi/cpp/dev/text_input_dev.h ('k') | ppapi/cpp/input_event.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698