| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_tsf.h" | 5 #include "ui/base/ime/input_method_tsf.h" |
| 6 | 6 |
| 7 #include "ui/base/ime/text_input_client.h" | 7 #include "ui/base/ime/text_input_client.h" |
| 8 #include "ui/base/ime/win/tsf_bridge.h" | 8 #include "ui/base/ime/win/tsf_bridge.h" |
| 9 | 9 |
| 10 namespace ui { | 10 namespace ui { |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 OnTextInputTypeChanged(focused); | 112 OnTextInputTypeChanged(focused); |
| 113 | 113 |
| 114 // Force to update caret bounds, in case the client thinks that the caret | 114 // Force to update caret bounds, in case the client thinks that the caret |
| 115 // bounds has not changed. | 115 // bounds has not changed. |
| 116 OnCaretBoundsChanged(focused); | 116 OnCaretBoundsChanged(focused); |
| 117 } | 117 } |
| 118 } | 118 } |
| 119 | 119 |
| 120 void InputMethodTSF::ConfirmCompositionText() { | 120 void InputMethodTSF::ConfirmCompositionText() { |
| 121 if (!IsTextInputTypeNone()) { | 121 if (!IsTextInputTypeNone()) { |
| 122 // TSFBridge has not implemented ConfirmComposition yet. So here cancel | 122 ui::TSFBridge::GetInstance()->ConfirmComposition(); |
| 123 // the composition instead as a workaround. | |
| 124 // TODO(ime): Implement ConfirmComposition for TSF. | |
| 125 ui::TSFBridge::GetInstance()->CancelComposition(); | |
| 126 } | 123 } |
| 127 } | 124 } |
| 128 | 125 |
| 129 bool InputMethodTSF::IsWindowFocused(const TextInputClient* client) const { | 126 bool InputMethodTSF::IsWindowFocused(const TextInputClient* client) const { |
| 130 if (!client) | 127 if (!client) |
| 131 return false; | 128 return false; |
| 132 HWND attached_window_handle = GetAttachedWindowHandle(client); | 129 HWND attached_window_handle = GetAttachedWindowHandle(client); |
| 133 return attached_window_handle && GetFocus() == attached_window_handle; | 130 return attached_window_handle && GetFocus() == attached_window_handle; |
| 134 } | 131 } |
| 135 | 132 |
| 136 } // namespace ui | 133 } // namespace ui |
| OLD | NEW |