| 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 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 void InputMethodWin::OnTextInputTypeChanged(const TextInputClient* client) { | 223 void InputMethodWin::OnTextInputTypeChanged(const TextInputClient* client) { |
| 224 if (!IsTextInputClientFocused(client) || !IsWindowFocused(client)) | 224 if (!IsTextInputClientFocused(client) || !IsWindowFocused(client)) |
| 225 return; | 225 return; |
| 226 imm32_manager_.CancelIME(toplevel_window_handle_); | 226 imm32_manager_.CancelIME(toplevel_window_handle_); |
| 227 UpdateIMEState(); | 227 UpdateIMEState(); |
| 228 } | 228 } |
| 229 | 229 |
| 230 void InputMethodWin::OnCaretBoundsChanged(const TextInputClient* client) { | 230 void InputMethodWin::OnCaretBoundsChanged(const TextInputClient* client) { |
| 231 if (!IsTextInputClientFocused(client) || !IsWindowFocused(client)) | 231 if (!IsTextInputClientFocused(client) || !IsWindowFocused(client)) |
| 232 return; | 232 return; |
| 233 NotifyTextInputCaretBoundsChanged(client); | |
| 234 TextInputType text_input_type = GetTextInputType(); | 233 TextInputType text_input_type = GetTextInputType(); |
| 235 if (client == GetTextInputClient() && | 234 if (client == GetTextInputClient() && |
| 236 text_input_type != TEXT_INPUT_TYPE_NONE && | 235 text_input_type != TEXT_INPUT_TYPE_NONE && |
| 237 text_input_type != TEXT_INPUT_TYPE_PASSWORD && GetEngine()) { | 236 text_input_type != TEXT_INPUT_TYPE_PASSWORD && GetEngine()) { |
| 238 // |enabled_| == false could be faked, and the engine should rely on the | 237 // |enabled_| == false could be faked, and the engine should rely on the |
| 239 // real type from GetTextInputType(). | 238 // real type from GetTextInputType(). |
| 240 GetEngine()->SetCompositionBounds(GetCompositionBounds(client)); | 239 GetEngine()->SetCompositionBounds(GetCompositionBounds(client)); |
| 241 } | 240 } |
| 242 if (!enabled_) | 241 if (!enabled_) |
| 243 return; | 242 return; |
| (...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 759 ui::IMEEngineHandlerInterface* engine = GetEngine(); | 758 ui::IMEEngineHandlerInterface* engine = GetEngine(); |
| 760 if (engine) { | 759 if (engine) { |
| 761 if (old_text_input_type != ui::TEXT_INPUT_TYPE_NONE) | 760 if (old_text_input_type != ui::TEXT_INPUT_TYPE_NONE) |
| 762 engine->FocusOut(); | 761 engine->FocusOut(); |
| 763 if (GetTextInputType() != ui::TEXT_INPUT_TYPE_NONE) | 762 if (GetTextInputType() != ui::TEXT_INPUT_TYPE_NONE) |
| 764 engine->FocusIn(context); | 763 engine->FocusIn(context); |
| 765 } | 764 } |
| 766 } | 765 } |
| 767 | 766 |
| 768 } // namespace ui | 767 } // namespace ui |
| OLD | NEW |