| 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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 } | 86 } |
| 87 | 87 |
| 88 void InputMethodTSF::SetFocusedTextInputClient(TextInputClient* client) { | 88 void InputMethodTSF::SetFocusedTextInputClient(TextInputClient* client) { |
| 89 if (IsWindowFocused(client)) { | 89 if (IsWindowFocused(client)) { |
| 90 ui::TSFBridge::GetInstance()->SetFocusedClient( | 90 ui::TSFBridge::GetInstance()->SetFocusedClient( |
| 91 GetAttachedWindowHandle(client), client); | 91 GetAttachedWindowHandle(client), client); |
| 92 } | 92 } |
| 93 InputMethodWin::SetFocusedTextInputClient(client); | 93 InputMethodWin::SetFocusedTextInputClient(client); |
| 94 } | 94 } |
| 95 | 95 |
| 96 bool InputMethodTSF::IsCandidatePopupOpen() const { |
| 97 // TODO(yukishiino): Implement this method. |
| 98 return false; |
| 99 } |
| 100 |
| 96 void InputMethodTSF::OnWillChangeFocusedClient(TextInputClient* focused_before, | 101 void InputMethodTSF::OnWillChangeFocusedClient(TextInputClient* focused_before, |
| 97 TextInputClient* focused) { | 102 TextInputClient* focused) { |
| 98 if (IsWindowFocused(focused_before)) { | 103 if (IsWindowFocused(focused_before)) { |
| 99 ConfirmCompositionText(); | 104 ConfirmCompositionText(); |
| 100 ui::TSFBridge::GetInstance()->RemoveFocusedClient(focused_before); | 105 ui::TSFBridge::GetInstance()->RemoveFocusedClient(focused_before); |
| 101 } | 106 } |
| 102 } | 107 } |
| 103 | 108 |
| 104 void InputMethodTSF::OnDidChangeFocusedClient(TextInputClient* focused_before, | 109 void InputMethodTSF::OnDidChangeFocusedClient(TextInputClient* focused_before, |
| 105 TextInputClient* focused) { | 110 TextInputClient* focused) { |
| (...skipping 21 matching lines...) Expand all Loading... |
| 127 } | 132 } |
| 128 | 133 |
| 129 bool InputMethodTSF::IsWindowFocused(const TextInputClient* client) const { | 134 bool InputMethodTSF::IsWindowFocused(const TextInputClient* client) const { |
| 130 if (!client) | 135 if (!client) |
| 131 return false; | 136 return false; |
| 132 HWND attached_window_handle = GetAttachedWindowHandle(client); | 137 HWND attached_window_handle = GetAttachedWindowHandle(client); |
| 133 return attached_window_handle && GetFocus() == attached_window_handle; | 138 return attached_window_handle && GetFocus() == attached_window_handle; |
| 134 } | 139 } |
| 135 | 140 |
| 136 } // namespace ui | 141 } // namespace ui |
| OLD | NEW |