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

Side by Side Diff: webkit/plugins/ppapi/ppb_text_input_impl.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
« no previous file with comments | « webkit/plugins/ppapi/ppb_text_input_impl.h ('k') | webkit/plugins/ppapi/resource_tracker.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "webkit/plugins/ppapi/ppb_text_input_impl.h"
6
7 #include "base/logging.h"
8 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h"
9
10 namespace webkit {
11 namespace ppapi {
12
13 PPB_TextInput_Impl::PPB_TextInput_Impl(PluginInstance* instance)
14 : instance_(instance) {
15 }
16
17 ::ppapi::thunk::PPB_TextInput_FunctionAPI*
18 PPB_TextInput_Impl::AsPPB_TextInput_FunctionAPI() {
19 return this;
20 }
21
22 COMPILE_ASSERT(int(WebKit::WebTextInputTypeNone) == \
23 int(PP_TEXTINPUT_TYPE_NONE), mismatching_enums);
24 COMPILE_ASSERT(int(WebKit::WebTextInputTypeText) == \
25 int(PP_TEXTINPUT_TYPE_TEXT), mismatching_enums);
26 COMPILE_ASSERT(int(WebKit::WebTextInputTypePassword) == \
27 int(PP_TEXTINPUT_TYPE_PASSWORD), mismatching_enums);
28 COMPILE_ASSERT(int(WebKit::WebTextInputTypeSearch) == \
29 int(PP_TEXTINPUT_TYPE_SEARCH), mismatching_enums);
30 COMPILE_ASSERT(int(WebKit::WebTextInputTypeEmail) == \
31 int(PP_TEXTINPUT_TYPE_EMAIL), mismatching_enums);
32 COMPILE_ASSERT(int(WebKit::WebTextInputTypeNumber) == \
33 int(PP_TEXTINPUT_TYPE_NUMBER), mismatching_enums);
34 COMPILE_ASSERT(int(WebKit::WebTextInputTypeTelephone) == \
35 int(PP_TEXTINPUT_TYPE_TELEPHONE), mismatching_enums);
36 COMPILE_ASSERT(int(WebKit::WebTextInputTypeURL) == \
37 int(PP_TEXTINPUT_TYPE_URL), mismatching_enums);
38
39 void PPB_TextInput_Impl::SetTextInputType(PP_Instance instance,
40 PP_TextInput_Type type) {
41 int itype = type;
42 if (itype<0 || itype>WebKit::WebTextInputTypeURL)
43 itype = WebKit::WebTextInputTypeNone;
44 instance_->SetTextInputType(static_cast<WebKit::WebTextInputType>(itype));
45 }
46
47 void PPB_TextInput_Impl::UpdateCaretPosition(PP_Instance instance,
48 const PP_Rect& caret,
49 const PP_Rect& boundingBox) {
50 instance_->UpdateCaretPosition(caret, boundingBox);
51 }
52
53 void PPB_TextInput_Impl::ConfirmCompositionText(PP_Instance instance) {
54 // TODO(kinaba)
55 NOTIMPLEMENTED();
56 }
57
58 void PPB_TextInput_Impl::CancelCompositionText(PP_Instance instance) {
59 // TODO(kinaba)
60 NOTIMPLEMENTED();
61 }
62
63 } // namespace ppapi
64 } // namespace webkit
OLDNEW
« no previous file with comments | « webkit/plugins/ppapi/ppb_text_input_impl.h ('k') | webkit/plugins/ppapi/resource_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698