diff options
author | hbono@chromium.org <hbono@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-23 05:35:02 +0000 |
---|---|---|
committer | hbono@chromium.org <hbono@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-23 05:35:02 +0000 |
commit | f338a0ed8c0490fad58fa47799c98909e8750978 (patch) | |
tree | bb27f6d22afaeca65f41fd6b226fe32812193e7d /chrome/browser/renderer_host/render_widget_host.cc | |
parent | abe7a89488d132d650aff0846ccd9a0b83d4a1f1 (diff) | |
download | chromium_src-f338a0ed8c0490fad58fa47799c98909e8750978.zip chromium_src-f338a0ed8c0490fad58fa47799c98909e8750978.tar.gz chromium_src-f338a0ed8c0490fad58fa47799c98909e8750978.tar.bz2 |
Integrating GtkIMContext into the RenderWidgetHostViewGtk class.This change implements signal handers of the GtkIMContext object to support IMEs and dead-keys. Also, to improve compatibility with Windows Chrome, this change emulates IPC messages sent on Windows when we input characters and fixes Issue 13604 as well as Issue 10953 and 11226. Even though I notice we need more work for fixing edge cases (e.g. disabling IMEs on a password input) on Linux, I think this is the good starting point. (Supporting edge-cases requires complicated code and it makes hard to review.)
BUG=10953 "IME support"
BUG=11226 "Dead keys and accents input not working"
BUG=13604 "Hotkeys not working in non-us keyboard layout"
TEST=Open a web page which contains an <input> form (e.g. <http://www.google.com/>), type a '[{' key and an 'A' key on a Canadian-French keyboard, and see a Latin character "U+00E2" is displayed in the <input> form.
TEST=Open a web page which contains an <input> form (e.g. <http://www.google.com/>), enable an Chinese Pinyin IME, type a 'W' key, type an 'O' key, and see a Chinese character is displayed in the <input> form.
TEST=Change the keyboard layout to Hebrew (or Russian), open a web page which contains an <input> form, input some characters in the <input> form, type control+a, and see the text in the <input> form is selected.
Review URL: http://codereview.chromium.org/126118
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19009 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/renderer_host/render_widget_host.cc')
-rw-r--r-- | chrome/browser/renderer_host/render_widget_host.cc | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/chrome/browser/renderer_host/render_widget_host.cc b/chrome/browser/renderer_host/render_widget_host.cc index 51d2b3b..fd734bb 100644 --- a/chrome/browser/renderer_host/render_widget_host.cc +++ b/chrome/browser/renderer_host/render_widget_host.cc @@ -424,6 +424,28 @@ void RenderWidgetHost::NotifyTextDirection() { } } +void RenderWidgetHost::ImeSetInputMode(bool activate) { + Send(new ViewMsg_ImeSetInputMode(routing_id(), activate)); +} + +void RenderWidgetHost::ImeSetComposition(const std::wstring& ime_string, + int cursor_position, + int target_start, + int target_end) { + Send(new ViewMsg_ImeSetComposition(routing_id(), 0, cursor_position, + target_start, target_end, ime_string)); +} + +void RenderWidgetHost::ImeConfirmComposition(const std::wstring& ime_string) { + Send(new ViewMsg_ImeSetComposition(routing_id(), 1, -1, -1, -1, ime_string)); +} + +void RenderWidgetHost::ImeCancelComposition() { + std::wstring empty_string; + Send(new ViewMsg_ImeSetComposition(routing_id(), -1, -1, -1, -1, + empty_string)); +} + gfx::Rect RenderWidgetHost::GetRootWindowResizerRect() const { return gfx::Rect(); } |