| Index: ui/views/widget/native_widget_win.cc
|
| ===================================================================
|
| --- ui/views/widget/native_widget_win.cc (revision 154445)
|
| +++ ui/views/widget/native_widget_win.cc (working copy)
|
| @@ -249,7 +249,12 @@
|
| }
|
|
|
| InputMethod* NativeWidgetWin::CreateInputMethod() {
|
| - return message_handler_->CreateInputMethod();
|
| +#if !defined(USE_AURA)
|
| + CommandLine* command_line = CommandLine::ForCurrentProcess();
|
| + if (!command_line->HasSwitch(switches::kEnableViewsTextfield))
|
| + return NULL;
|
| +#endif
|
| + return new InputMethodWin(GetMessageHandler());
|
| }
|
|
|
| internal::InputMethodDelegate* NativeWidgetWin::GetInputMethodDelegate() {
|
| @@ -470,7 +475,7 @@
|
| }
|
|
|
| gfx::Rect NativeWidgetWin::GetWorkAreaBoundsInScreen() const {
|
| - return message_handler_->GetWorkAreaBoundsInScreen();
|
| + return gfx::Screen::GetDisplayNearestWindow(GetNativeView()).work_area();
|
| }
|
|
|
| void NativeWidgetWin::SetInactiveRenderingDisabled(bool value) {
|
| @@ -746,10 +751,16 @@
|
|
|
| void NativeWidgetWin::HandleNativeFocus(HWND last_focused_window) {
|
| delegate_->OnNativeFocus(last_focused_window);
|
| + InputMethod* input_method = GetInputMethod();
|
| + if (input_method)
|
| + input_method->OnFocus();
|
| }
|
|
|
| void NativeWidgetWin::HandleNativeBlur(HWND focused_window) {
|
| delegate_->OnNativeBlur(focused_window);
|
| + InputMethod* input_method = GetInputMethod();
|
| + if (input_method)
|
| + input_method->OnBlur();
|
| }
|
|
|
| bool NativeWidgetWin::HandleMouseEvent(const ui::MouseEvent& event) {
|
| @@ -760,6 +771,38 @@
|
| return delegate_->OnKeyEvent(event);
|
| }
|
|
|
| +bool NativeWidgetWin::HandleUntranslatedKeyEvent(const ui::KeyEvent& event) {
|
| + InputMethod* input_method = GetInputMethod();
|
| + if (input_method)
|
| + input_method->DispatchKeyEvent(event);
|
| + return !!input_method;
|
| +}
|
| +
|
| +bool NativeWidgetWin::HandleIMEMessage(UINT message,
|
| + WPARAM w_param,
|
| + LPARAM l_param,
|
| + LRESULT* result) {
|
| + InputMethod* input_method = GetInputMethod();
|
| + if (!input_method || input_method->IsMock()) {
|
| + *result = 0;
|
| + 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;
|
| +}
|
| +
|
| +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);
|
| + }
|
| +}
|
| +
|
| bool NativeWidgetWin::HandlePaintAccelerated(const gfx::Rect& invalid_rect) {
|
| return delegate_->OnNativeWidgetPaintAccelerated(gfx::Rect(invalid_rect));
|
| }
|
|
|