summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/render_widget.h
diff options
context:
space:
mode:
authorsuzhe@chromium.org <suzhe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-23 17:53:04 +0000
committersuzhe@chromium.org <suzhe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-23 17:53:04 +0000
commitfa7b1dc866e2a5af457602e015ebc84ab05c75b9 (patch)
treee0226343303b9925c10deba260ed00e7f91aa8dd /chrome/renderer/render_widget.h
parent31825d4399cf8c44f86f828f5662c885c85e8b49 (diff)
downloadchromium_src-fa7b1dc866e2a5af457602e015ebc84ab05c75b9.zip
chromium_src-fa7b1dc866e2a5af457602e015ebc84ab05c75b9.tar.gz
chromium_src-fa7b1dc866e2a5af457602e015ebc84ab05c75b9.tar.bz2
Improve input method support.
This CL fixes following issues: BUG=23219 IME should be disabled in password box. BUG=41876 Chinese IME is still active when current focus is not a text input control BUG=44529 Clause segmentation information of composition text is not honored when using CJK input methods. BUG=46326 Clicking during a composition cancels it TEST=See individual bug report. This CL is blocked on webkit bug: https://bugs.webkit.org/show_bug.cgi?id=40608 Review URL: http://codereview.chromium.org/2824015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50622 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/render_widget.h')
-rw-r--r--chrome/renderer/render_widget.h51
1 files changed, 21 insertions, 30 deletions
diff --git a/chrome/renderer/render_widget.h b/chrome/renderer/render_widget.h
index d2c8347..d602fec4 100644
--- a/chrome/renderer/render_widget.h
+++ b/chrome/renderer/render_widget.h
@@ -19,10 +19,11 @@
#include "gfx/size.h"
#include "ipc/ipc_channel.h"
#include "skia/ext/platform_canvas.h"
-#include "third_party/WebKit/WebKit/chromium/public/WebCompositionCommand.h"
+#include "third_party/WebKit/WebKit/chromium/public/WebCompositionUnderline.h"
#include "third_party/WebKit/WebKit/chromium/public/WebPopupType.h"
#include "third_party/WebKit/WebKit/chromium/public/WebRect.h"
#include "third_party/WebKit/WebKit/chromium/public/WebTextDirection.h"
+#include "third_party/WebKit/WebKit/chromium/public/WebTextInputType.h"
#include "third_party/WebKit/WebKit/chromium/public/WebWidgetClient.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "webkit/glue/webcursor.h"
@@ -92,6 +93,7 @@ class RenderWidget : public IPC::Channel::Listener,
virtual WebKit::WebRect windowResizerRect();
virtual WebKit::WebRect rootWindowRect();
virtual WebKit::WebScreenInfo screenInfo();
+ virtual void resetInputMethod();
// Called when a plugin is moved. These events are queued up and sent with
// the next paint or scroll message to the host.
@@ -156,11 +158,13 @@ class RenderWidget : public IPC::Channel::Listener,
void OnHandleInputEvent(const IPC::Message& message);
void OnMouseCaptureLost();
virtual void OnSetFocus(bool enable);
- void OnImeSetInputMode(bool is_active);
- void OnImeSetComposition(WebKit::WebCompositionCommand command,
- int cursor_position,
- int target_start, int target_end,
- const string16& ime_string);
+ void OnSetInputMethodActive(bool is_active);
+ void OnImeSetComposition(
+ const string16& text,
+ const std::vector<WebKit::WebCompositionUnderline>& underlines,
+ int selection_start,
+ int selection_end);
+ void OnImeConfirmComposition();
void OnMsgPaintAtSize(const TransportDIB::Handle& dib_id,
const gfx::Size& page_size,
const gfx::Size& desired_size);
@@ -192,12 +196,9 @@ class RenderWidget : public IPC::Channel::Listener,
void set_next_paint_is_restore_ack();
void set_next_paint_is_repaint_ack();
- // Called when a renderer process moves an input focus or updates the
- // position of its caret.
- // This function compares them with the previous values, and send them to
- // the browser process only if they are updated.
- // The browser process moves IME windows and context.
- void UpdateIME();
+ // Checks if the input method state and caret position have been changed.
+ // If they are changed, the new value will be sent to the browser process.
+ void UpdateInputMethod();
// Tells the renderer it does not have focus. Used to prevent us from getting
// the focus on our own when the browser did not focus us.
@@ -288,24 +289,14 @@ class RenderWidget : public IPC::Channel::Listener,
// be sent, except for a Close.
bool closing_;
- // Represents whether or not the IME of a browser process is active.
- bool ime_is_active_;
-
- // Represents the status of the selected edit control sent to a browser
- // process last time.
- // When a renderer process finishes rendering a region, it retrieves:
- // * The identifier of the selected edit control;
- // * Whether or not the selected edit control requires IME, and;
- // * The position of the caret (or cursor).
- // If the above values is updated, a renderer process sends an IPC message
- // to a browser process. A browser process uses these values to
- // activate/deactivate IME and set the position of IME windows.
- bool ime_control_enable_ime_;
- int ime_control_x_;
- int ime_control_y_;
- bool ime_control_new_state_;
- bool ime_control_updated_;
- bool ime_control_busy_;
+ // Indicates if an input method is active in the browser process.
+ bool input_method_is_active_;
+
+ // Stores the current text input type of |webwidget_|.
+ WebKit::WebTextInputType text_input_type_;
+
+ // Stores the current caret bounds of input focus.
+ WebKit::WebRect caret_bounds_;
// The kind of popup this widget represents, NONE if not a popup.
WebKit::WebPopupType popup_type_;