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 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 text_input_type != TEXT_INPUT_TYPE_PASSWORD && GetEngine()) { | 260 text_input_type != TEXT_INPUT_TYPE_PASSWORD && GetEngine()) { |
261 GetEngine()->Reset(); | 261 GetEngine()->Reset(); |
262 } | 262 } |
263 | 263 |
264 if (enabled_) | 264 if (enabled_) |
265 imm32_manager_.CancelIME(toplevel_window_handle_); | 265 imm32_manager_.CancelIME(toplevel_window_handle_); |
266 } | 266 } |
267 } | 267 } |
268 | 268 |
269 void InputMethodWin::OnInputLocaleChanged() { | 269 void InputMethodWin::OnInputLocaleChanged() { |
270 // Note: OnInputLocaleChanged() is for crbug.com/168971. | 270 // Note: OnInputLocaleChanged() is for capturing the input language which can |
| 271 // be used to determine the appropriate TextInputType for Omnibox. |
| 272 // See crbug.com/344834. |
| 273 // Currently OnInputLocaleChanged() on Windows relies on WM_INPUTLANGCHANGED, |
| 274 // which is known to be incompatible with TSF. |
| 275 // TODO(shuchen): Use ITfLanguageProfileNotifySink instead. |
271 OnInputMethodChanged(); | 276 OnInputMethodChanged(); |
| 277 imm32_manager_.SetInputLanguage(); |
272 } | 278 } |
273 | 279 |
274 std::string InputMethodWin::GetInputLocale() { | 280 bool InputMethodWin::IsInputLocaleCJK() const { |
275 return imm32_manager_.GetInputLanguageName(); | 281 return imm32_manager_.IsInputLanguageCJK(); |
276 } | 282 } |
277 | 283 |
278 bool InputMethodWin::IsCandidatePopupOpen() const { | 284 bool InputMethodWin::IsCandidatePopupOpen() const { |
279 return is_candidate_popup_open_; | 285 return is_candidate_popup_open_; |
280 } | 286 } |
281 | 287 |
282 void InputMethodWin::OnWillChangeFocusedClient(TextInputClient* focused_before, | 288 void InputMethodWin::OnWillChangeFocusedClient(TextInputClient* focused_before, |
283 TextInputClient* focused) { | 289 TextInputClient* focused) { |
284 if (IsWindowFocused(focused_before)) | 290 if (IsWindowFocused(focused_before)) |
285 ConfirmCompositionText(); | 291 ConfirmCompositionText(); |
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
705 ui::IMEEngineHandlerInterface* engine = GetEngine(); | 711 ui::IMEEngineHandlerInterface* engine = GetEngine(); |
706 if (engine) { | 712 if (engine) { |
707 if (old_text_input_type != ui::TEXT_INPUT_TYPE_NONE) | 713 if (old_text_input_type != ui::TEXT_INPUT_TYPE_NONE) |
708 engine->FocusOut(); | 714 engine->FocusOut(); |
709 if (GetTextInputType() != ui::TEXT_INPUT_TYPE_NONE) | 715 if (GetTextInputType() != ui::TEXT_INPUT_TYPE_NONE) |
710 engine->FocusIn(context); | 716 engine->FocusIn(context); |
711 } | 717 } |
712 } | 718 } |
713 | 719 |
714 } // namespace ui | 720 } // namespace ui |
OLD | NEW |