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 #include "ui/base/ime/win/tsf_event_router.h" | 9 #include "ui/base/ime/win/tsf_event_router.h" |
10 | 10 |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 } else { | 123 } else { |
124 // SetFocusedTextInputClient(NULL) must be interpreted as | 124 // SetFocusedTextInputClient(NULL) must be interpreted as |
125 // "Remove the attached client". | 125 // "Remove the attached client". |
126 ui::TSFBridge::GetInstance()->RemoveFocusedClient( | 126 ui::TSFBridge::GetInstance()->RemoveFocusedClient( |
127 ui::TSFBridge::GetInstance()->GetFocusedTextInputClient()); | 127 ui::TSFBridge::GetInstance()->GetFocusedTextInputClient()); |
128 } | 128 } |
129 } | 129 } |
130 InputMethodWin::SetFocusedTextInputClient(client); | 130 InputMethodWin::SetFocusedTextInputClient(client); |
131 } | 131 } |
132 | 132 |
| 133 void InputMethodTSF::DetachTextInputClient(TextInputClient* client) { |
| 134 InputMethodWin::DetachTextInputClient(client); |
| 135 ui::TSFBridge::GetInstance()->RemoveFocusedClient(client); |
| 136 } |
| 137 |
133 bool InputMethodTSF::IsCandidatePopupOpen() const { | 138 bool InputMethodTSF::IsCandidatePopupOpen() const { |
134 return tsf_event_observer_->IsCandidatePopupOpen(); | 139 return tsf_event_observer_->IsCandidatePopupOpen(); |
135 } | 140 } |
136 | 141 |
137 void InputMethodTSF::OnWillChangeFocusedClient(TextInputClient* focused_before, | 142 void InputMethodTSF::OnWillChangeFocusedClient(TextInputClient* focused_before, |
138 TextInputClient* focused) { | 143 TextInputClient* focused) { |
139 if (IsWindowFocused(focused_before)) { | 144 if (IsWindowFocused(focused_before)) { |
140 ConfirmCompositionText(); | 145 ConfirmCompositionText(); |
141 ui::TSFBridge::GetInstance()->RemoveFocusedClient(focused_before); | 146 ui::TSFBridge::GetInstance()->RemoveFocusedClient(focused_before); |
142 } | 147 } |
(...skipping 20 matching lines...) Expand all Loading... |
163 if (!IsTextInputTypeNone()) | 168 if (!IsTextInputTypeNone()) |
164 ui::TSFBridge::GetInstance()->ConfirmComposition(); | 169 ui::TSFBridge::GetInstance()->ConfirmComposition(); |
165 } | 170 } |
166 | 171 |
167 bool InputMethodTSF::IsWindowFocused(const TextInputClient* client) const { | 172 bool InputMethodTSF::IsWindowFocused(const TextInputClient* client) const { |
168 HWND attached_window_handle = GetAttachedWindowHandle(client); | 173 HWND attached_window_handle = GetAttachedWindowHandle(client); |
169 return attached_window_handle && GetFocus() == attached_window_handle; | 174 return attached_window_handle && GetFocus() == attached_window_handle; |
170 } | 175 } |
171 | 176 |
172 } // namespace ui | 177 } // namespace ui |
OLD | NEW |