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); |
233 TextInputType text_input_type = GetTextInputType(); | 234 TextInputType text_input_type = GetTextInputType(); |
234 if (client == GetTextInputClient() && | 235 if (client == GetTextInputClient() && |
235 text_input_type != TEXT_INPUT_TYPE_NONE && | 236 text_input_type != TEXT_INPUT_TYPE_NONE && |
236 text_input_type != TEXT_INPUT_TYPE_PASSWORD && GetEngine()) { | 237 text_input_type != TEXT_INPUT_TYPE_PASSWORD && GetEngine()) { |
237 // |enabled_| == false could be faked, and the engine should rely on the | 238 // |enabled_| == false could be faked, and the engine should rely on the |
238 // real type from GetTextInputType(). | 239 // real type from GetTextInputType(). |
239 GetEngine()->SetCompositionBounds(GetCompositionBounds(client)); | 240 GetEngine()->SetCompositionBounds(GetCompositionBounds(client)); |
240 } | 241 } |
241 if (!enabled_) | 242 if (!enabled_) |
242 return; | 243 return; |
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
758 ui::IMEEngineHandlerInterface* engine = GetEngine(); | 759 ui::IMEEngineHandlerInterface* engine = GetEngine(); |
759 if (engine) { | 760 if (engine) { |
760 if (old_text_input_type != ui::TEXT_INPUT_TYPE_NONE) | 761 if (old_text_input_type != ui::TEXT_INPUT_TYPE_NONE) |
761 engine->FocusOut(); | 762 engine->FocusOut(); |
762 if (GetTextInputType() != ui::TEXT_INPUT_TYPE_NONE) | 763 if (GetTextInputType() != ui::TEXT_INPUT_TYPE_NONE) |
763 engine->FocusIn(context); | 764 engine->FocusIn(context); |
764 } | 765 } |
765 } | 766 } |
766 | 767 |
767 } // namespace ui | 768 } // namespace ui |
OLD | NEW |