| 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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 // focus and after it acquires focus again are the same. | 116 // focus and after it acquires focus again are the same. |
| 117 OnTextInputTypeChanged(focused); | 117 OnTextInputTypeChanged(focused); |
| 118 | 118 |
| 119 // Force to update caret bounds, in case the client thinks that the caret | 119 // Force to update caret bounds, in case the client thinks that the caret |
| 120 // bounds has not changed. | 120 // bounds has not changed. |
| 121 OnCaretBoundsChanged(focused); | 121 OnCaretBoundsChanged(focused); |
| 122 } | 122 } |
| 123 } | 123 } |
| 124 | 124 |
| 125 void InputMethodTSF::ConfirmCompositionText() { | 125 void InputMethodTSF::ConfirmCompositionText() { |
| 126 if (!IsTextInputTypeNone()) { | 126 if (!IsTextInputTypeNone()) |
| 127 // TSFBridge has not implemented ConfirmComposition yet. So here cancel | 127 ui::TSFBridge::GetInstance()->ConfirmComposition(); |
| 128 // the composition instead as a workaround. | |
| 129 // TODO(ime): Implement ConfirmComposition for TSF. | |
| 130 ui::TSFBridge::GetInstance()->CancelComposition(); | |
| 131 } | |
| 132 } | 128 } |
| 133 | 129 |
| 134 bool InputMethodTSF::IsWindowFocused(const TextInputClient* client) const { | 130 bool InputMethodTSF::IsWindowFocused(const TextInputClient* client) const { |
| 135 if (!client) | 131 if (!client) |
| 136 return false; | 132 return false; |
| 137 HWND attached_window_handle = GetAttachedWindowHandle(client); | 133 HWND attached_window_handle = GetAttachedWindowHandle(client); |
| 138 return attached_window_handle && GetFocus() == attached_window_handle; | 134 return attached_window_handle && GetFocus() == attached_window_handle; |
| 139 } | 135 } |
| 140 | 136 |
| 141 } // namespace ui | 137 } // namespace ui |
| OLD | NEW |