| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 #include <cwctype> | 9 #include <cwctype> |
| 10 | 10 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 InputMethodWin::InputMethodWin(internal::InputMethodDelegate* delegate, | 45 InputMethodWin::InputMethodWin(internal::InputMethodDelegate* delegate, |
| 46 HWND toplevel_window_handle) | 46 HWND toplevel_window_handle) |
| 47 : toplevel_window_handle_(toplevel_window_handle), | 47 : toplevel_window_handle_(toplevel_window_handle), |
| 48 pending_requested_direction_(base::i18n::UNKNOWN_DIRECTION), | 48 pending_requested_direction_(base::i18n::UNKNOWN_DIRECTION), |
| 49 accept_carriage_return_(false), | 49 accept_carriage_return_(false), |
| 50 enabled_(false), | 50 enabled_(false), |
| 51 is_candidate_popup_open_(false), | 51 is_candidate_popup_open_(false), |
| 52 composing_window_handle_(NULL), | 52 composing_window_handle_(NULL), |
| 53 weak_ptr_factory_(this) { | 53 weak_ptr_factory_(this) { |
| 54 SetDelegate(delegate); | 54 SetDelegate(delegate); |
| 55 imm32_manager_.SetInputLanguage(); |
| 55 } | 56 } |
| 56 | 57 |
| 57 InputMethodWin::~InputMethodWin() {} | 58 InputMethodWin::~InputMethodWin() {} |
| 58 | 59 |
| 59 bool InputMethodWin::OnUntranslatedIMEMessage( | 60 bool InputMethodWin::OnUntranslatedIMEMessage( |
| 60 const base::NativeEvent& event, | 61 const base::NativeEvent& event, |
| 61 InputMethod::NativeEventResult* result) { | 62 InputMethod::NativeEventResult* result) { |
| 62 LRESULT original_result = 0; | 63 LRESULT original_result = 0; |
| 63 BOOL handled = FALSE; | 64 BOOL handled = FALSE; |
| 64 | 65 |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 | 269 |
| 269 void InputMethodWin::OnInputLocaleChanged() { | 270 void InputMethodWin::OnInputLocaleChanged() { |
| 270 // Note: OnInputLocaleChanged() is for capturing the input language which can | 271 // Note: OnInputLocaleChanged() is for capturing the input language which can |
| 271 // be used to determine the appropriate TextInputType for Omnibox. | 272 // be used to determine the appropriate TextInputType for Omnibox. |
| 272 // See crbug.com/344834. | 273 // See crbug.com/344834. |
| 273 // Currently OnInputLocaleChanged() on Windows relies on WM_INPUTLANGCHANGED, | 274 // Currently OnInputLocaleChanged() on Windows relies on WM_INPUTLANGCHANGED, |
| 274 // which is known to be incompatible with TSF. | 275 // which is known to be incompatible with TSF. |
| 275 // TODO(shuchen): Use ITfLanguageProfileNotifySink instead. | 276 // TODO(shuchen): Use ITfLanguageProfileNotifySink instead. |
| 276 OnInputMethodChanged(); | 277 OnInputMethodChanged(); |
| 277 imm32_manager_.SetInputLanguage(); | 278 imm32_manager_.SetInputLanguage(); |
| 279 UpdateIMEState(); |
| 278 } | 280 } |
| 279 | 281 |
| 280 bool InputMethodWin::IsInputLocaleCJK() const { | 282 bool InputMethodWin::IsInputLocaleCJK() const { |
| 281 return imm32_manager_.IsInputLanguageCJK(); | 283 return imm32_manager_.IsInputLanguageCJK(); |
| 282 } | 284 } |
| 283 | 285 |
| 284 bool InputMethodWin::IsCandidatePopupOpen() const { | 286 bool InputMethodWin::IsCandidatePopupOpen() const { |
| 285 return is_candidate_popup_open_; | 287 return is_candidate_popup_open_; |
| 286 } | 288 } |
| 287 | 289 |
| (...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 731 ui::IMEEngineHandlerInterface* engine = GetEngine(); | 733 ui::IMEEngineHandlerInterface* engine = GetEngine(); |
| 732 if (engine) { | 734 if (engine) { |
| 733 if (old_text_input_type != ui::TEXT_INPUT_TYPE_NONE) | 735 if (old_text_input_type != ui::TEXT_INPUT_TYPE_NONE) |
| 734 engine->FocusOut(); | 736 engine->FocusOut(); |
| 735 if (GetTextInputType() != ui::TEXT_INPUT_TYPE_NONE) | 737 if (GetTextInputType() != ui::TEXT_INPUT_TYPE_NONE) |
| 736 engine->FocusIn(context); | 738 engine->FocusIn(context); |
| 737 } | 739 } |
| 738 } | 740 } |
| 739 | 741 |
| 740 } // namespace ui | 742 } // namespace ui |
| OLD | NEW |