OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/base/ime/input_method_win.h" | 5 #include "ui/base/ime/input_method_win.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "ui/base/ime/text_input_client.h" | 8 #include "ui/base/ime/text_input_client.h" |
9 #include "ui/base/ime/win/tsf_input_scope.h" | 9 #include "ui/base/ime/win/tsf_input_scope.h" |
10 #include "ui/events/event.h" | 10 #include "ui/events/event.h" |
(...skipping 551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
562 // window. So we can safely assume that |attached_window_handle| is ready for | 562 // window. So we can safely assume that |attached_window_handle| is ready for |
563 // receiving keyboard input as long as it is an active window. This works well | 563 // receiving keyboard input as long as it is an active window. This works well |
564 // even when the |attached_window_handle| becomes active but has not received | 564 // even when the |attached_window_handle| becomes active but has not received |
565 // WM_FOCUS yet. | 565 // WM_FOCUS yet. |
566 return attached_window_handle && GetActiveWindow() == attached_window_handle; | 566 return attached_window_handle && GetActiveWindow() == attached_window_handle; |
567 } | 567 } |
568 | 568 |
569 bool InputMethodWin::DispatchFabricatedKeyEvent(const ui::KeyEvent& event) { | 569 bool InputMethodWin::DispatchFabricatedKeyEvent(const ui::KeyEvent& event) { |
570 if (event.is_char()) { | 570 if (event.is_char()) { |
571 if (GetTextInputClient()) { | 571 if (GetTextInputClient()) { |
572 GetTextInputClient()->InsertChar(event.key_code(), | 572 GetTextInputClient()->InsertChar( |
573 ui::GetModifiersFromKeyState()); | 573 static_cast<base::char16>(event.key_code()), |
| 574 ui::GetModifiersFromKeyState()); |
574 return true; | 575 return true; |
575 } | 576 } |
576 } | 577 } |
577 return DispatchKeyEventPostIME(event); | 578 return DispatchKeyEventPostIME(event); |
578 } | 579 } |
579 | 580 |
580 void InputMethodWin::ConfirmCompositionText() { | 581 void InputMethodWin::ConfirmCompositionText() { |
581 if (composing_window_handle_) | 582 if (composing_window_handle_) |
582 imm32_manager_.CleanupComposition(composing_window_handle_); | 583 imm32_manager_.CleanupComposition(composing_window_handle_); |
583 | 584 |
(...skipping 23 matching lines...) Expand all Loading... |
607 enabled_ = true; | 608 enabled_ = true; |
608 break; | 609 break; |
609 } | 610 } |
610 | 611 |
611 imm32_manager_.SetTextInputMode(window_handle, text_input_mode); | 612 imm32_manager_.SetTextInputMode(window_handle, text_input_mode); |
612 tsf_inputscope::SetInputScopeForTsfUnawareWindow( | 613 tsf_inputscope::SetInputScopeForTsfUnawareWindow( |
613 window_handle, text_input_type, text_input_mode); | 614 window_handle, text_input_type, text_input_mode); |
614 } | 615 } |
615 | 616 |
616 } // namespace ui | 617 } // namespace ui |
OLD | NEW |