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

Unified Diff: webkit/plugins/ppapi/ppapi_plugin_instance.h

Issue 7977017: Never submit: tentative Pepper IME. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 3 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
Index: webkit/plugins/ppapi/ppapi_plugin_instance.h
diff --git a/webkit/plugins/ppapi/ppapi_plugin_instance.h b/webkit/plugins/ppapi/ppapi_plugin_instance.h
index 346e157f9b863ed9825f680e410e3404fa853558..96fa08f6ca451ee5727e3745539f2f8342705404 100644
--- a/webkit/plugins/ppapi/ppapi_plugin_instance.h
+++ b/webkit/plugins/ppapi/ppapi_plugin_instance.h
@@ -22,6 +22,7 @@
#include "ppapi/c/pp_instance.h"
#include "ppapi/c/pp_resource.h"
#include "ppapi/c/pp_var.h"
+#include "ppapi/c/ppb_input_event.h"
#include "ppapi/c/ppp_graphics_3d.h"
#include "ppapi/c/ppp_instance.h"
#include "ppapi/shared_impl/function_group_base.h"
@@ -31,6 +32,8 @@
#include "third_party/skia/include/core/SkBitmap.h"
#include "third_party/skia/include/core/SkRefCnt.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebCanvas.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/WebTextInputType.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/WebRect.h"
#include "ui/gfx/rect.h"
#include "webkit/plugins/ppapi/plugin_delegate.h"
@@ -56,6 +59,7 @@ namespace WebKit {
struct WebCursorInfo;
class WebInputEvent;
class WebPluginContainer;
+struct WebCompositionUnderline;
}
namespace ppapi {
@@ -167,6 +171,25 @@ class PluginInstance : public base::RefCounted<PluginInstance>,
PP_Var GetInstanceObject();
void ViewChanged(const gfx::Rect& position, const gfx::Rect& clip);
+ // Handlers for composition events.
+ bool HandleCompositionStart(const string16& text);
+ bool HandleCompositionUpdate(
+ const string16& text,
+ const std::vector<WebKit::WebCompositionUnderline>& underlines,
+ int selection_start,
+ int selection_end);
+ bool HandleCompositionEnd(const string16& text);
+ bool HandleTextInput(const string16& text);
+
+ // Implementation of composition API.
+ void UpdateCaretPosition(const PP_Rect& caret, const PP_Rect& boundingBox);
+ void SetTextInputType(WebKit::WebTextInputType type);
+
+ // Gets the current text input status.
+ WebKit::WebTextInputType text_input_type() const { return text_input_type_; }
+ WebKit::WebRect GetCaretBounds() const;
+ bool CanComposeInline() const;
+
// Notifications about focus changes, see has_webkit_focus_ below.
void SetWebKitFocus(bool has_focus);
void SetContentAreaFocus(bool has_focus);
@@ -365,6 +388,17 @@ class PluginInstance : public base::RefCounted<PluginInstance>,
void DoSetCursor(WebKit::WebCursorInfo* cursor);
+ // Internal helper functions for HandleCompositionXXX().
+ bool SendCompositionEventToPlugin(
+ PP_InputEvent_Type type,
+ const string16& text);
+ bool SendCompositionEventWithUnderlineInformationToPlugin(
+ PP_InputEvent_Type type,
+ const string16& text,
+ const std::vector<WebKit::WebCompositionUnderline>& underlines,
+ int selection_start,
+ int selection_end);
+
PluginDelegate* delegate_;
scoped_refptr<PluginModule> module_;
scoped_ptr< ::ppapi::PPP_Instance_Combined> instance_interface_;
@@ -485,6 +519,12 @@ class PluginInstance : public base::RefCounted<PluginInstance>,
uint32_t input_event_mask_;
uint32_t filtered_input_event_mask_;
+ // Text composition status.
+ WebKit::WebTextInputType text_input_type_;
+ PP_Rect text_input_caret_;
+ PP_Rect text_input_caret_bounds_;
+ bool text_input_caret_set_;
+
PP_CompletionCallback lock_mouse_callback_;
DISALLOW_COPY_AND_ASSIGN(PluginInstance);

Powered by Google App Engine
This is Rietveld 408576698