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

Unified Diff: ppapi/api/dev/ppb_text_input_dev.idl

Issue 8769003: Pepper IME API for surrounding text retrieval. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge master. Created 8 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/render_view_impl.cc ('k') | ppapi/api/dev/ppp_text_input_dev.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/api/dev/ppb_text_input_dev.idl
diff --git a/ppapi/api/dev/ppb_text_input_dev.idl b/ppapi/api/dev/ppb_text_input_dev.idl
index fde2574a616b5b3fe1c8fd8e9b1f4805e4a57b3f..d8c417613259442da1dd7e88fbc6730ed9fe3fa2 100644
--- a/ppapi/api/dev/ppb_text_input_dev.idl
+++ b/ppapi/api/dev/ppb_text_input_dev.idl
@@ -8,7 +8,8 @@
*/
label Chrome {
- M16 = 0.1
+ M16 = 0.1,
+ M19 = 0.2
};
/**
@@ -66,4 +67,43 @@ interface PPB_TextInput_Dev {
* Cancels the current composition in IME.
*/
void CancelCompositionText([in] PP_Instance instance);
+
+ /**
+ * In response to the <code>PPP_TextInput_Dev::RequestSurroundingText</code>
+ * call, informs the browser about the current text selection and surrounding
+ * text. <code>text</code> is a UTF-8 string that contains the current range
+ * of text selection in the plugin. <code>caret</code> is the byte-index of
+ * the caret poisition within <code>text</code>. <code>anchor</code> is the
+ * byte-index of the anchor position (i.e., if a range of text is selected,
+ * it is the other edge of selection diffrent from <code>caret</code>. If
+ * there are no selection, <code>anchor</code> is equal to <code>caret</code>.
+ *
+ * Typical use of this information in the browser is to enable "reconversion"
+ * features of IME that puts back the already committed text into the
+ * pre-commit composition state. Another use is to improve the precision
+ * of suggestion of IME by taking the context into account (e.g., if the caret
+ * looks to be on the begining of a sentense, suggest capital letters in a
+ * virtual keyboard).
+ *
+ * When the focus is not on text, call this function setting <code>text</code>
+ * to an empty string and <code>caret</code> and <code>anchor</code> to zero.
+ * Also, the plugin should send the empty text when it does not want to reveal
+ * the selection to IME (e.g., when the surrounding text is containing
+ * password text).
+ */
+ [version=0.2]
+ void UpdateSurroundingText([in] PP_Instance instance,
+ [in] str_t text,
+ [in] uint32_t caret,
+ [in] uint32_t anchor);
+
+ /**
+ * Informs the browser when a range of text selection is changed in a plugin.
+ * When the browser needs to know the content of the updated selection, it
+ * pings back by <code>PPP_TextInput_Dev::RequestSurroundingText</code>. The
+ * plugin then should send the information with
+ * <code>UpdateSurroundingText</code>.
+ */
+ [version=0.2]
+ void SelectionChanged([in] PP_Instance instance);
};
« no previous file with comments | « content/renderer/render_view_impl.cc ('k') | ppapi/api/dev/ppp_text_input_dev.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698