From 3c8c74c98b54130795812527b5b3eb6c569123c2 Mon Sep 17 00:00:00 2001 From: "kinaba@chromium.org" Date: Thu, 15 Mar 2012 07:34:52 +0000 Subject: Pepper IME API for surrounding text retrieval. IME benefits from knowing what portion of text is selected inside a text editing plugin. This change is to implement a Pepper API for doing it. It consists of three API functions: 1. Browser asks plugins by PPP_TextInput_Dev::RequestSurroundingText() to send such info. 2. Plugin must reply the query by PPB_TextInput_Dev::UpdateSurroundingText(). 3. Additionally, plugin notifies the browser by PPB_TextInput_Dev::SelectionChanged() that the selection is changed. Typically triggers the steps 1->2. Intention of the API design is (1) to avoid synchronous IPC, and (2) to keep the room to implement it in an optimal and right way, that is, expensive send of selection text happens only when needed (= "IME requiring the info is on" + "selection indeed changed in the plugin"), though the current impl in the patch is not necessary like that (for sake of simplicity). The changes in the API is in: * ppapi/c/dev/ppb_text_input_dev.h * ppapi/c/dev/ppp_text_input_dev.h The browser side implementation mostly resides in: * content/renderer/render_view_impl.cc * content/renderer/pepper/pepper_plugin_delegate_impl.{h,cc} * webkit/plugins/ppapi/ppapi_plugin_instance.{h,cc} The other files are for wiring necessary cables. BUG=101101 TEST=Manual: make ppapi_example_ime and run ./your/chrome --register-pepper-plugins=\ "/path/to/ppapi_example_ime.plugin;application/x-ppapi-example-ime" \ --ppapi-out-of-process \ file:///path/to/ppapi/examples/ime/ime.html Try some IME that supports reconversion (e.g., Google Japanese Input on Windows). Review URL: http://codereview.chromium.org/8769003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@126862 0039d316-1c4b-4281-b951-d872f2087c98 --- ppapi/shared_impl/api_id.h | 1 + 1 file changed, 1 insertion(+) (limited to 'ppapi/shared_impl/api_id.h') diff --git a/ppapi/shared_impl/api_id.h b/ppapi/shared_impl/api_id.h index 60aa90b..325247f 100644 --- a/ppapi/shared_impl/api_id.h +++ b/ppapi/shared_impl/api_id.h @@ -60,6 +60,7 @@ enum ApiID { API_ID_PPP_MESSAGING, API_ID_PPP_MOUSE_LOCK, API_ID_PPP_PRINTING, + API_ID_PPP_TEXT_INPUT, API_ID_PPP_VIDEO_CAPTURE_DEV, API_ID_PPP_VIDEO_DECODER_DEV, -- cgit v1.1