Skip to content

Commit

Permalink
Rename PP_TextInputType to PP_TextInputType_Dev
Browse files Browse the repository at this point in the history
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
  • Loading branch information
nona@chromium.org committed Aug 7, 2013
1 parent b0aa6ae commit d33b11a
Show file tree
Hide file tree
Showing 10 changed files with 95 additions and 38 deletions.
20 changes: 10 additions & 10 deletions ppapi/api/dev/ppb_text_input_dev.idl
Original file line number Diff line number Diff line change
Expand Up @@ -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
};

/**
Expand All @@ -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
Expand Down
26 changes: 13 additions & 13 deletions ppapi/c/dev/ppb_text_input_dev.h
Original file line number Diff line number Diff line change
Expand Up @@ -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_
Expand Down Expand Up @@ -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);
/**
* @}
*/
Expand All @@ -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
Expand Down Expand Up @@ -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);
Expand Down
36 changes: 34 additions & 2 deletions ppapi/c/ppb_text_input_controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -27,6 +26,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
* @{
Expand Down
2 changes: 1 addition & 1 deletion ppapi/cpp/dev/text_input_dev.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion ppapi/cpp/dev/text_input_dev.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions ppapi/native_client/src/trusted/plugin/plugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@
#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"
#include "ppapi/cpp/input_event.h"
#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"
Expand Down Expand Up @@ -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.
Expand Down
4 changes: 0 additions & 4 deletions ppapi/native_client/src/untrusted/pnacl_irt_shim/pnacl_shim.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -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 */
Expand Down
2 changes: 1 addition & 1 deletion ppapi/proxy/ppapi_messages.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion ppapi/thunk/ppb_instance_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down
35 changes: 32 additions & 3 deletions ppapi/thunk/ppb_text_input_thunk.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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) {
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit d33b11a

Please sign in to comment.