diff options
author | kinaba@chromium.org <kinaba@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-15 07:34:52 +0000 |
---|---|---|
committer | kinaba@chromium.org <kinaba@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-15 07:34:52 +0000 |
commit | 3c8c74c98b54130795812527b5b3eb6c569123c2 (patch) | |
tree | 880d846d4d98dfd57c7f5a0fc7f30879fde2a993 /ppapi/proxy/interface_list.cc | |
parent | 8cdb650a50c6d00099d030e4dbbba7eca82379cd (diff) | |
download | chromium_src-3c8c74c98b54130795812527b5b3eb6c569123c2.zip chromium_src-3c8c74c98b54130795812527b5b3eb6c569123c2.tar.gz chromium_src-3c8c74c98b54130795812527b5b3eb6c569123c2.tar.bz2 |
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
Diffstat (limited to 'ppapi/proxy/interface_list.cc')
-rw-r--r-- | ppapi/proxy/interface_list.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/ppapi/proxy/interface_list.cc b/ppapi/proxy/interface_list.cc index 374bbf2..e746ffd 100644 --- a/ppapi/proxy/interface_list.cc +++ b/ppapi/proxy/interface_list.cc @@ -109,6 +109,7 @@ #include "ppapi/proxy/ppp_messaging_proxy.h" #include "ppapi/proxy/ppp_mouse_lock_proxy.h" #include "ppapi/proxy/ppp_printing_proxy.h" +#include "ppapi/proxy/ppp_text_input_proxy.h" #include "ppapi/proxy/ppp_video_decoder_proxy.h" #include "ppapi/proxy/resource_creation_proxy.h" #include "ppapi/shared_impl/ppb_opengles2_shared.h" @@ -222,6 +223,9 @@ InterfaceList::InterfaceList() { AddProxy(API_ID_PPP_PRINTING, &ProxyFactory<PPP_Printing_Proxy>); AddPPP(PPP_PRINTING_DEV_INTERFACE, API_ID_PPP_PRINTING, PPP_Printing_Proxy::GetProxyInterface()); + AddProxy(API_ID_PPP_TEXT_INPUT, &ProxyFactory<PPP_TextInput_Proxy>); + AddPPP(PPP_TEXTINPUT_DEV_INTERFACE, API_ID_PPP_TEXT_INPUT, + PPP_TextInput_Proxy::GetProxyInterface()); // Old-style GetInfo PPP interfaces. // Do not add more stuff here, they should be added to interface_list*.h |