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

Unified Diff: webkit/plugins/ppapi/ppb_text_input_impl.cc

Issue 8073021: Implement Pepper IME API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge trunk. Created 9 years, 2 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 | « webkit/plugins/ppapi/ppapi_plugin_instance.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/plugins/ppapi/ppb_text_input_impl.cc
diff --git a/webkit/plugins/ppapi/ppb_text_input_impl.cc b/webkit/plugins/ppapi/ppb_text_input_impl.cc
index fc02925749a9911c1576edaa4f2ca4f32deeede7..9a1cc9220168a445ef4ac2e2b15df1d2180cf3d7 100644
--- a/webkit/plugins/ppapi/ppb_text_input_impl.cc
+++ b/webkit/plugins/ppapi/ppb_text_input_impl.cc
@@ -5,7 +5,8 @@
#include "webkit/plugins/ppapi/ppb_text_input_impl.h"
#include "base/logging.h"
-#include "third_party/WebKit/Source/WebKit/chromium/public/WebTextInputType.h"
+#include "ui/base/ime/text_input_type.h"
+#include "ui/gfx/rect.h"
#include "webkit/plugins/ppapi/ppapi_plugin_instance.h"
namespace webkit {
@@ -20,39 +21,44 @@ PPB_TextInput_Impl::AsPPB_TextInput_FunctionAPI() {
return this;
}
-COMPILE_ASSERT(int(WebKit::WebTextInputTypeNone) == \
+// Check PP_TextInput_Type and ui::TextInputType are kept in sync.
+COMPILE_ASSERT(int(ui::TEXT_INPUT_TYPE_NONE) == \
int(PP_TEXTINPUT_TYPE_NONE), mismatching_enums);
-COMPILE_ASSERT(int(WebKit::WebTextInputTypeText) == \
+COMPILE_ASSERT(int(ui::TEXT_INPUT_TYPE_TEXT) == \
int(PP_TEXTINPUT_TYPE_TEXT), mismatching_enums);
-COMPILE_ASSERT(int(WebKit::WebTextInputTypePassword) == \
+COMPILE_ASSERT(int(ui::TEXT_INPUT_TYPE_PASSWORD) == \
int(PP_TEXTINPUT_TYPE_PASSWORD), mismatching_enums);
-COMPILE_ASSERT(int(WebKit::WebTextInputTypeSearch) == \
+COMPILE_ASSERT(int(ui::TEXT_INPUT_TYPE_SEARCH) == \
int(PP_TEXTINPUT_TYPE_SEARCH), mismatching_enums);
-COMPILE_ASSERT(int(WebKit::WebTextInputTypeEmail) == \
+COMPILE_ASSERT(int(ui::TEXT_INPUT_TYPE_EMAIL) == \
int(PP_TEXTINPUT_TYPE_EMAIL), mismatching_enums);
-COMPILE_ASSERT(int(WebKit::WebTextInputTypeNumber) == \
+COMPILE_ASSERT(int(ui::TEXT_INPUT_TYPE_NUMBER) == \
int(PP_TEXTINPUT_TYPE_NUMBER), mismatching_enums);
-COMPILE_ASSERT(int(WebKit::WebTextInputTypeTelephone) == \
+COMPILE_ASSERT(int(ui::TEXT_INPUT_TYPE_TELEPHONE) == \
int(PP_TEXTINPUT_TYPE_TELEPHONE), mismatching_enums);
-COMPILE_ASSERT(int(WebKit::WebTextInputTypeURL) == \
+COMPILE_ASSERT(int(ui::TEXT_INPUT_TYPE_URL) == \
int(PP_TEXTINPUT_TYPE_URL), mismatching_enums);
void PPB_TextInput_Impl::SetTextInputType(PP_Instance instance,
PP_TextInput_Type type) {
- // TODO(kinaba) the implementation is split to another CL for reviewing.
- NOTIMPLEMENTED();
+ int itype = type;
+ if (itype < 0 || itype > ui::TEXT_INPUT_TYPE_URL)
+ itype = ui::TEXT_INPUT_TYPE_NONE;
+ instance_->SetTextInputType(static_cast<ui::TextInputType>(itype));
}
void PPB_TextInput_Impl::UpdateCaretPosition(PP_Instance instance,
const PP_Rect& caret,
const PP_Rect& bounding_box) {
- // TODO(kinaba) the implementation is split to another CL for reviewing.
- NOTIMPLEMENTED();
+ instance_->UpdateCaretPosition(
+ gfx::Rect(caret.point.x, caret.point.y,
+ caret.size.width, caret.size.height),
+ gfx::Rect(bounding_box.point.x, bounding_box.point.y,
+ bounding_box.size.width, bounding_box.size.height));
}
void PPB_TextInput_Impl::CancelCompositionText(PP_Instance instance) {
- // TODO(kinaba) the implementation is split to another CL for reviewing.
- NOTIMPLEMENTED();
+ instance_->delegate()->PluginRequestedCancelComposition(instance_);
}
} // namespace ppapi
« no previous file with comments | « webkit/plugins/ppapi/ppapi_plugin_instance.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698