summaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorYukawa@chromium.org <Yukawa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-14 07:58:20 +0000
committerYukawa@chromium.org <Yukawa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-14 07:58:20 +0000
commit7100ba5ad237edebabbd5a86efdb30c536b6d242 (patch)
tree6edbbe9689d395cc547d72c64a0bf4e7e8530002 /ui
parent6de18237160952e00e2e65ecd2395ae16d3dd516 (diff)
downloadchromium_src-7100ba5ad237edebabbd5a86efdb30c536b6d242.zip
chromium_src-7100ba5ad237edebabbd5a86efdb30c536b6d242.tar.gz
chromium_src-7100ba5ad237edebabbd5a86efdb30c536b6d242.tar.bz2
Stop using downcastings in Win32 IME message handling.
This is the second part of the refactoring to get rid of downcastings from Win32 IME messages handling. The previous CL added two new methods into the InputMethod interface. By using these new methods, this CL actually removes downcastings. BUG=246534 Review URL: https://chromiumcodereview.appspot.com/16940002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@206367 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui')
-rw-r--r--ui/views/widget/desktop_aura/desktop_root_window_host_win.cc27
-rw-r--r--ui/views/widget/native_widget_win.cc13
2 files changed, 17 insertions, 23 deletions
diff --git a/ui/views/widget/desktop_aura/desktop_root_window_host_win.cc b/ui/views/widget/desktop_aura/desktop_root_window_host_win.cc
index 8c936a7..06db00b 100644
--- a/ui/views/widget/desktop_aura/desktop_root_window_host_win.cc
+++ b/ui/views/widget/desktop_aura/desktop_root_window_host_win.cc
@@ -13,7 +13,7 @@
#include "ui/aura/root_window.h"
#include "ui/aura/window_property.h"
#include "ui/base/cursor/cursor_loader_win.h"
-#include "ui/base/ime/input_method_win.h"
+#include "ui/base/ime/input_method.h"
#include "ui/base/ime/win/tsf_bridge.h"
#include "ui/base/win/dpi.h"
#include "ui/base/win/shell.h"
@@ -799,27 +799,20 @@ bool DesktopRootWindowHostWin::HandleIMEMessage(UINT message,
WPARAM w_param,
LPARAM l_param,
LRESULT* result) {
- // TODO(ime): Having to cast here is wrong. Maybe we should have IME events
- // and have these flow through the same path as
- // HandleUnHandletranslatedKeyEvent() does.
- ui::InputMethodWin* ime_win =
- static_cast<ui::InputMethodWin*>(
- desktop_native_widget_aura_->input_method_event_filter()->
- input_method());
- BOOL handled = FALSE;
- *result = ime_win->OnImeMessages(message, w_param, l_param, &handled);
- return !!handled;
+ MSG msg = {};
+ msg.hwnd = GetHWND();
+ msg.message = message;
+ msg.wParam = w_param;
+ msg.lParam = l_param;
+ return desktop_native_widget_aura_->input_method_event_filter()->
+ input_method()->OnUntranslatedIMEMessage(msg, result);
}
void DesktopRootWindowHostWin::HandleInputLanguageChange(
DWORD character_set,
HKL input_language_id) {
- // TODO(ime): Seem comment in HandleIMEMessage().
- ui::InputMethodWin* ime_win =
- static_cast<ui::InputMethodWin*>(
- desktop_native_widget_aura_->input_method_event_filter()->
- input_method());
- ime_win->OnInputLangChange(character_set, input_language_id);
+ desktop_native_widget_aura_->input_method_event_filter()->
+ input_method()->OnInputLocaleChanged();
}
bool DesktopRootWindowHostWin::HandlePaintAccelerated(
diff --git a/ui/views/widget/native_widget_win.cc b/ui/views/widget/native_widget_win.cc
index 5271318..3edb636 100644
--- a/ui/views/widget/native_widget_win.cc
+++ b/ui/views/widget/native_widget_win.cc
@@ -773,18 +773,19 @@ bool NativeWidgetWin::HandleIMEMessage(UINT message,
return false;
}
- InputMethodWin* ime_win = static_cast<InputMethodWin*>(input_method);
- BOOL handled = FALSE;
- *result = ime_win->OnImeMessages(message, w_param, l_param, &handled);
- return !!handled;
+ MSG msg = {};
+ msg.hwnd = message_handler_->hwnd();
+ msg.message = message;
+ msg.wParam = w_param;
+ msg.lParam = l_param;
+ return input_method->OnUntranslatedIMEMessage(msg, result);
}
void NativeWidgetWin::HandleInputLanguageChange(DWORD character_set,
HKL input_language_id) {
InputMethod* input_method = GetInputMethod();
if (input_method && !input_method->IsMock()) {
- static_cast<InputMethodWin*>(input_method)->OnInputLangChange(
- character_set, input_language_id);
+ input_method->OnInputLocaleChanged();
}
}