diff options
author | nona@chromium.org <nona@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-07 09:57:28 +0000 |
---|---|---|
committer | nona@chromium.org <nona@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-07 09:57:28 +0000 |
commit | d33b11ac76f6cee90e9674682a0bdd9725eeeb00 (patch) | |
tree | 7ba29256348554c19a6bbcb7c39a32cd8a683ecc | |
parent | b0aa6ae154f37c1a88af79c015fbe045ff314ab2 (diff) | |
download | chromium_src-d33b11ac76f6cee90e9674682a0bdd9725eeeb00.zip chromium_src-d33b11ac76f6cee90e9674682a0bdd9725eeeb00.tar.gz chromium_src-d33b11ac76f6cee90e9674682a0bdd9725eeeb00.tar.bz2 |
Rename PP_TextInputType to PP_TextInputType_Dev
Duplicated PP_TextInput_Type breaks generator so dropping PP_TextInput_Type from ppb_text_input_controller.idl
We can't drop this enum from dev interface because dev interface is still used for Flash plugin.
Once Flash uses stable interface, we can move this enum to ppb_text_input_controller.idl with removing dev interface.
I confirmed this change does not breaks generator.py and build_sdk.py, and also current flash plugin still works correctly.
BUG=None
TBR=piman
TEST=try bots
NOTRY=True
Review URL: https://chromiumcodereview.appspot.com/22364006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@216141 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | ppapi/api/dev/ppb_text_input_dev.idl | 20 | ||||
-rw-r--r-- | ppapi/c/dev/ppb_text_input_dev.h | 26 | ||||
-rw-r--r-- | ppapi/c/ppb_text_input_controller.h | 36 | ||||
-rw-r--r-- | ppapi/cpp/dev/text_input_dev.cc | 2 | ||||
-rw-r--r-- | ppapi/cpp/dev/text_input_dev.h | 2 | ||||
-rw-r--r-- | ppapi/native_client/src/trusted/plugin/plugin.cc | 4 | ||||
-rw-r--r-- | ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c | 4 | ||||
-rw-r--r-- | ppapi/proxy/ppapi_messages.h | 2 | ||||
-rw-r--r-- | ppapi/thunk/ppb_instance_api.h | 2 | ||||
-rw-r--r-- | ppapi/thunk/ppb_text_input_thunk.cc | 35 |
10 files changed, 95 insertions, 38 deletions
diff --git a/ppapi/api/dev/ppb_text_input_dev.idl b/ppapi/api/dev/ppb_text_input_dev.idl index 27704b0..7ea49013 100644 --- a/ppapi/api/dev/ppb_text_input_dev.idl +++ b/ppapi/api/dev/ppb_text_input_dev.idl @@ -17,25 +17,25 @@ label Chrome { * text input. */ [assert_size(4)] -enum PP_TextInput_Type { +enum PP_TextInput_Type_Dev { /** * Input caret is not in an editable mode, no input method shall be used. */ - PP_TEXTINPUT_TYPE_NONE = 0, + PP_TEXTINPUT_TYPE_DEV_NONE = 0, /** * Input caret is in a normal editable mode, any input method can be used. */ - PP_TEXTINPUT_TYPE_TEXT = 1, + PP_TEXTINPUT_TYPE_DEV_TEXT = 1, /** * Input caret is in a password box, an input method may be used only if * it's suitable for password input. */ - PP_TEXTINPUT_TYPE_PASSWORD = 2, - PP_TEXTINPUT_TYPE_SEARCH = 3, - PP_TEXTINPUT_TYPE_EMAIL = 4, - PP_TEXTINPUT_TYPE_NUMBER = 5, - PP_TEXTINPUT_TYPE_TELEPHONE = 6, - PP_TEXTINPUT_TYPE_URL = 7 + PP_TEXTINPUT_TYPE_DEV_PASSWORD = 2, + PP_TEXTINPUT_TYPE_DEV_SEARCH = 3, + PP_TEXTINPUT_TYPE_DEV_EMAIL = 4, + PP_TEXTINPUT_TYPE_DEV_NUMBER = 5, + PP_TEXTINPUT_TYPE_DEV_TELEPHONE = 6, + PP_TEXTINPUT_TYPE_DEV_URL = 7 }; /** @@ -52,7 +52,7 @@ interface PPB_TextInput_Dev { * used for composing East Asian characters). */ void SetTextInputType([in] PP_Instance instance, - [in] PP_TextInput_Type type); + [in] PP_TextInput_Type_Dev type); /** * Informs the browser about the coordinates of the text input caret and the diff --git a/ppapi/c/dev/ppb_text_input_dev.h b/ppapi/c/dev/ppb_text_input_dev.h index 8b7df44..516f20f 100644 --- a/ppapi/c/dev/ppb_text_input_dev.h +++ b/ppapi/c/dev/ppb_text_input_dev.h @@ -3,7 +3,7 @@ * found in the LICENSE file. */ -/* From dev/ppb_text_input_dev.idl modified Thu Mar 28 10:54:47 2013. */ +/* From dev/ppb_text_input_dev.idl modified Tue Aug 6 10:37:25 2013. */ #ifndef PPAPI_C_DEV_PPB_TEXT_INPUT_DEV_H_ #define PPAPI_C_DEV_PPB_TEXT_INPUT_DEV_H_ @@ -37,23 +37,23 @@ typedef enum { /** * Input caret is not in an editable mode, no input method shall be used. */ - PP_TEXTINPUT_TYPE_NONE = 0, + PP_TEXTINPUT_TYPE_DEV_NONE = 0, /** * Input caret is in a normal editable mode, any input method can be used. */ - PP_TEXTINPUT_TYPE_TEXT = 1, + PP_TEXTINPUT_TYPE_DEV_TEXT = 1, /** * Input caret is in a password box, an input method may be used only if * it's suitable for password input. */ - PP_TEXTINPUT_TYPE_PASSWORD = 2, - PP_TEXTINPUT_TYPE_SEARCH = 3, - PP_TEXTINPUT_TYPE_EMAIL = 4, - PP_TEXTINPUT_TYPE_NUMBER = 5, - PP_TEXTINPUT_TYPE_TELEPHONE = 6, - PP_TEXTINPUT_TYPE_URL = 7 -} PP_TextInput_Type; -PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_TextInput_Type, 4); + PP_TEXTINPUT_TYPE_DEV_PASSWORD = 2, + PP_TEXTINPUT_TYPE_DEV_SEARCH = 3, + PP_TEXTINPUT_TYPE_DEV_EMAIL = 4, + PP_TEXTINPUT_TYPE_DEV_NUMBER = 5, + PP_TEXTINPUT_TYPE_DEV_TELEPHONE = 6, + PP_TEXTINPUT_TYPE_DEV_URL = 7 +} PP_TextInput_Type_Dev; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_TextInput_Type_Dev, 4); /** * @} */ @@ -75,7 +75,7 @@ struct PPB_TextInput_Dev_0_2 { * keyboards in touch screen based devices, or input method editors often * used for composing East Asian characters). */ - void (*SetTextInputType)(PP_Instance instance, PP_TextInput_Type type); + void (*SetTextInputType)(PP_Instance instance, PP_TextInput_Type_Dev type); /** * Informs the browser about the coordinates of the text input caret and the * bounding box of the text input area. Typical use of this information in @@ -128,7 +128,7 @@ struct PPB_TextInput_Dev_0_2 { typedef struct PPB_TextInput_Dev_0_2 PPB_TextInput_Dev; struct PPB_TextInput_Dev_0_1 { - void (*SetTextInputType)(PP_Instance instance, PP_TextInput_Type type); + void (*SetTextInputType)(PP_Instance instance, PP_TextInput_Type_Dev type); void (*UpdateCaretPosition)(PP_Instance instance, const struct PP_Rect* caret, const struct PP_Rect* bounding_box); diff --git a/ppapi/c/ppb_text_input_controller.h b/ppapi/c/ppb_text_input_controller.h index bc7cdb850..43b88ac 100644 --- a/ppapi/c/ppb_text_input_controller.h +++ b/ppapi/c/ppb_text_input_controller.h @@ -3,12 +3,11 @@ * found in the LICENSE file. */ -/* From ppb_text_input_controller.idl modified Sat Jul 27 00:04:53 2013. */ +/* From ppb_text_input_controller.idl modified Thu Aug 1 09:30:48 2013. */ #ifndef PPAPI_C_PPB_TEXT_INPUT_CONTROLLER_H_ #define PPAPI_C_PPB_TEXT_INPUT_CONTROLLER_H_ -#include "ppapi/c/dev/ppb_text_input_dev.h" #include "ppapi/c/pp_bool.h" #include "ppapi/c/pp_instance.h" #include "ppapi/c/pp_macros.h" @@ -28,6 +27,39 @@ /** + * @addtogroup Enums + * @{ + */ +/** + * PP_TextInput_Type is used to indicate the status of a plugin in regard to + * text input. + */ +typedef enum { + /** + * Input caret is not in an editable mode, no input method shall be used. + */ + PP_TEXTINPUT_TYPE_NONE = 0, + /** + * Input caret is in a normal editable mode, any input method can be used. + */ + PP_TEXTINPUT_TYPE_TEXT = 1, + /** + * Input caret is in a password box, an input method may be used only if + * it's suitable for password input. + */ + PP_TEXTINPUT_TYPE_PASSWORD = 2, + PP_TEXTINPUT_TYPE_SEARCH = 3, + PP_TEXTINPUT_TYPE_EMAIL = 4, + PP_TEXTINPUT_TYPE_NUMBER = 5, + PP_TEXTINPUT_TYPE_TELEPHONE = 6, + PP_TEXTINPUT_TYPE_URL = 7 +} PP_TextInput_Type; +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_TextInput_Type, 4); +/** + * @} + */ + +/** * @addtogroup Interfaces * @{ */ diff --git a/ppapi/cpp/dev/text_input_dev.cc b/ppapi/cpp/dev/text_input_dev.cc index 657a0b3..b0fff8a 100644 --- a/ppapi/cpp/dev/text_input_dev.cc +++ b/ppapi/cpp/dev/text_input_dev.cc @@ -57,7 +57,7 @@ void TextInput_Dev::RequestSurroundingText(uint32_t) { UpdateSurroundingText(std::string(), 0, 0); } -void TextInput_Dev::SetTextInputType(PP_TextInput_Type type) { +void TextInput_Dev::SetTextInputType(PP_TextInput_Type_Dev type) { if (has_interface<PPB_TextInput_Dev_0_2>()) { get_interface<PPB_TextInput_Dev_0_2>()->SetTextInputType( instance_.pp_instance(), type); diff --git a/ppapi/cpp/dev/text_input_dev.h b/ppapi/cpp/dev/text_input_dev.h index ea75597..fca8728 100644 --- a/ppapi/cpp/dev/text_input_dev.h +++ b/ppapi/cpp/dev/text_input_dev.h @@ -45,7 +45,7 @@ class TextInput_Dev { virtual void RequestSurroundingText(uint32_t desired_number_of_characters); - void SetTextInputType(PP_TextInput_Type type); + void SetTextInputType(PP_TextInput_Type_Dev type); void UpdateCaretPosition(const Rect& caret, const Rect& bounding_box); void CancelCompositionText(); void SelectionChanged(); diff --git a/ppapi/native_client/src/trusted/plugin/plugin.cc b/ppapi/native_client/src/trusted/plugin/plugin.cc index 701fe01..5cbb9d7 100644 --- a/ppapi/native_client/src/trusted/plugin/plugin.cc +++ b/ppapi/native_client/src/trusted/plugin/plugin.cc @@ -44,7 +44,6 @@ #include "ppapi/cpp/dev/find_dev.h" #include "ppapi/cpp/dev/printing_dev.h" #include "ppapi/cpp/dev/selection_dev.h" -#include "ppapi/cpp/dev/text_input_dev.h" #include "ppapi/cpp/dev/url_util_dev.h" #include "ppapi/cpp/dev/zoom_dev.h" #include "ppapi/cpp/image_data.h" @@ -52,6 +51,7 @@ #include "ppapi/cpp/module.h" #include "ppapi/cpp/mouse_lock.h" #include "ppapi/cpp/rect.h" +#include "ppapi/cpp/text_input_controller.h" #include "ppapi/native_client/src/trusted/plugin/file_utils.h" #include "ppapi/native_client/src/trusted/plugin/json_manifest.h" @@ -318,7 +318,7 @@ bool Plugin::Init(int argc, char* argn[], char* argv[]) { // This makes discrepancy among platforms and therefore we should remove // this hack when IME API is made available. // The default for non-Mac platforms is still off-the-spot IME mode. - pp::TextInput_Dev(this).SetTextInputType(PP_TEXTINPUT_TYPE_NONE); + pp::TextInputController(this).SetTextInputType(PP_TEXTINPUT_TYPE_NONE); #endif // Remember the embed/object argn/argv pairs. diff --git a/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c b/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c index 9eabc69..3bcb28c 100644 --- a/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c +++ b/ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c @@ -1978,8 +1978,6 @@ static void Pnacl_M28_PPB_Testing_Dev_SetMinimumArrayBufferSizeForShmem(PP_Insta /* Not generating wrapper methods for PPB_TextInput_Dev_0_2 */ -/* Not generating wrapper methods for PPB_TextInput_Dev_None */ - /* Not generating wrapper methods for PPB_Trace_Event_Dev_0_1 */ /* Not generating wrapper methods for PPB_Trace_Event_Dev_0_2 */ @@ -4410,8 +4408,6 @@ struct PPB_Testing_Dev_0_92 Pnacl_Wrappers_PPB_Testing_Dev_0_92 = { /* Not generating wrapper interface for PPB_TextInput_Dev_0_2 */ -/* Not generating wrapper interface for PPB_TextInput_Dev_None */ - /* Not generating wrapper interface for PPB_Trace_Event_Dev_0_1 */ /* Not generating wrapper interface for PPB_Trace_Event_Dev_0_2 */ diff --git a/ppapi/proxy/ppapi_messages.h b/ppapi/proxy/ppapi_messages.h index 6f73e25..7ee568f 100644 --- a/ppapi/proxy/ppapi_messages.h +++ b/ppapi/proxy/ppapi_messages.h @@ -21,7 +21,6 @@ #include "ipc/ipc_platform_file.h" #include "ppapi/c/dev/pp_video_capture_dev.h" #include "ppapi/c/dev/pp_video_dev.h" -#include "ppapi/c/dev/ppb_text_input_dev.h" #include "ppapi/c/dev/ppb_truetype_font_dev.h" #include "ppapi/c/dev/ppb_url_util_dev.h" #include "ppapi/c/dev/ppp_printing_dev.h" @@ -37,6 +36,7 @@ #include "ppapi/c/ppb_audio_config.h" #include "ppapi/c/ppb_image_data.h" #include "ppapi/c/ppb_tcp_socket.h" +#include "ppapi/c/ppb_text_input_controller.h" #include "ppapi/c/ppb_udp_socket.h" #include "ppapi/c/private/pp_content_decryptor.h" #include "ppapi/c/private/pp_private_font_charset.h" diff --git a/ppapi/thunk/ppb_instance_api.h b/ppapi/thunk/ppb_instance_api.h index 3fa2edf..c1d024e 100644 --- a/ppapi/thunk/ppb_instance_api.h +++ b/ppapi/thunk/ppb_instance_api.h @@ -7,7 +7,6 @@ #include "base/memory/ref_counted.h" #include "base/memory/scoped_ptr.h" -#include "ppapi/c/dev/ppb_text_input_dev.h" #include "ppapi/c/dev/ppb_url_util_dev.h" #include "ppapi/c/pp_bool.h" #include "ppapi/c/pp_completion_callback.h" @@ -17,6 +16,7 @@ #include "ppapi/c/ppb_gamepad.h" #include "ppapi/c/ppb_instance.h" #include "ppapi/c/ppb_mouse_cursor.h" +#include "ppapi/c/ppb_text_input_controller.h" #include "ppapi/c/private/pp_content_decryptor.h" #include "ppapi/c/private/ppb_instance_private.h" #include "ppapi/shared_impl/api_id.h" diff --git a/ppapi/thunk/ppb_text_input_thunk.cc b/ppapi/thunk/ppb_text_input_thunk.cc index 55fb4c9..a59146b 100644 --- a/ppapi/thunk/ppb_text_input_thunk.cc +++ b/ppapi/thunk/ppb_text_input_thunk.cc @@ -2,8 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "base/basictypes.h" +#include "ppapi/c/dev/ppb_text_input_dev.h" #include "ppapi/c/ppb_text_input_controller.h" - #include "ppapi/shared_impl/var.h" #include "ppapi/thunk/enter.h" #include "ppapi/thunk/ppb_instance_api.h" @@ -14,12 +15,40 @@ namespace thunk { namespace { +COMPILE_ASSERT(int(PP_TEXTINPUT_TYPE_DEV_NONE) == int(PP_TEXTINPUT_TYPE_NONE), + mismatching_enums); +COMPILE_ASSERT(int(PP_TEXTINPUT_TYPE_DEV_TEXT) == int(PP_TEXTINPUT_TYPE_TEXT), + mismatching_enums); +COMPILE_ASSERT( + int(PP_TEXTINPUT_TYPE_DEV_PASSWORD) == int(PP_TEXTINPUT_TYPE_PASSWORD), + mismatching_enums); +COMPILE_ASSERT( + int(PP_TEXTINPUT_TYPE_DEV_SEARCH) == int(PP_TEXTINPUT_TYPE_SEARCH), + mismatching_enums); +COMPILE_ASSERT(int(PP_TEXTINPUT_TYPE_DEV_EMAIL) == int(PP_TEXTINPUT_TYPE_EMAIL), + mismatching_enums); +COMPILE_ASSERT( + int(PP_TEXTINPUT_TYPE_DEV_NUMBER) == int(PP_TEXTINPUT_TYPE_NUMBER), + mismatching_enums); +COMPILE_ASSERT( + int(PP_TEXTINPUT_TYPE_DEV_TELEPHONE) == int(PP_TEXTINPUT_TYPE_TELEPHONE), + mismatching_enums); +COMPILE_ASSERT(int(PP_TEXTINPUT_TYPE_DEV_URL) == int(PP_TEXTINPUT_TYPE_URL), + mismatching_enums); + void SetTextInputType(PP_Instance instance, PP_TextInput_Type type) { EnterInstance enter(instance); if (enter.succeeded()) enter.functions()->SetTextInputType(instance, type); } +void SetTextInputType_0_2(PP_Instance instance, PP_TextInput_Type_Dev type) { + EnterInstance enter(instance); + if (enter.succeeded()) + enter.functions()->SetTextInputType(instance, + static_cast<PP_TextInput_Type>(type)); +} + void UpdateCaretPosition_0_2(PP_Instance instance, const PP_Rect* caret, const PP_Rect* bounding_box) { @@ -66,13 +95,13 @@ void SelectionChanged(PP_Instance instance) { } const PPB_TextInput_Dev_0_1 g_ppb_textinput_0_1_thunk = { - &SetTextInputType, + &SetTextInputType_0_2, &UpdateCaretPosition_0_2, &CancelCompositionText, }; const PPB_TextInput_Dev_0_2 g_ppb_textinput_0_2_thunk = { - &SetTextInputType, + &SetTextInputType_0_2, &UpdateCaretPosition_0_2, &CancelCompositionText, &UpdateSurroundingText_0_2, |