| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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_linux_x11.h" | 5 #include "ui/base/ime/input_method_linux_x11.h" |
| 6 | 6 |
| 7 #include "ui/base/ime/linux/linux_input_method_context_factory.h" | 7 #include "ui/base/ime/linux/linux_input_method_context_factory.h" |
| 8 #include "ui/base/ime/text_input_client.h" | 8 #include "ui/base/ime/text_input_client.h" |
| 9 #include "ui/events/event.h" | 9 #include "ui/events/event.h" |
| 10 #include "ui/events/event_utils.h" | 10 #include "ui/events/event_utils.h" |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 void InputMethodLinuxX11::OnTextInputTypeChanged( | 103 void InputMethodLinuxX11::OnTextInputTypeChanged( |
| 104 const TextInputClient* client) { | 104 const TextInputClient* client) { |
| 105 if (IsTextInputClientFocused(client)) { | 105 if (IsTextInputClientFocused(client)) { |
| 106 input_method_context_->Reset(); | 106 input_method_context_->Reset(); |
| 107 // TODO(yoichio): Support inputmode HTML attribute. | 107 // TODO(yoichio): Support inputmode HTML attribute. |
| 108 input_method_context_->OnTextInputTypeChanged(client->GetTextInputType()); | 108 input_method_context_->OnTextInputTypeChanged(client->GetTextInputType()); |
| 109 } | 109 } |
| 110 InputMethodBase::OnTextInputTypeChanged(client); | 110 InputMethodBase::OnTextInputTypeChanged(client); |
| 111 } | 111 } |
| 112 | 112 |
| 113 void InputMethodLinuxX11::OnCaretBoundsChanged( | 113 void InputMethodLinuxX11::OnCaretBoundsChanged(const TextInputClient* client) { |
| 114 const TextInputClient* client) { | 114 if (IsTextInputClientFocused(client)) { |
| 115 if (!IsTextInputClientFocused(client)) | 115 input_method_context_->OnCaretBoundsChanged( |
| 116 return; | 116 GetTextInputClient()->GetCaretBounds()); |
| 117 | 117 } |
| 118 input_method_context_->OnCaretBoundsChanged( | 118 InputMethodBase::OnCaretBoundsChanged(client); |
| 119 GetTextInputClient()->GetCaretBounds()); | |
| 120 } | 119 } |
| 121 | 120 |
| 122 void InputMethodLinuxX11::CancelComposition(const TextInputClient* client) { | 121 void InputMethodLinuxX11::CancelComposition(const TextInputClient* client) { |
| 123 if (!IsTextInputClientFocused(client)) | 122 if (!IsTextInputClientFocused(client)) |
| 124 return; | 123 return; |
| 125 | 124 |
| 126 input_method_context_->Reset(); | 125 input_method_context_->Reset(); |
| 127 input_method_context_->OnTextInputTypeChanged(client->GetTextInputType()); | 126 input_method_context_->OnTextInputTypeChanged(client->GetTextInputType()); |
| 128 } | 127 } |
| 129 | 128 |
| 130 void InputMethodLinuxX11::OnInputLocaleChanged() { | 129 void InputMethodLinuxX11::OnInputLocaleChanged() { |
| 130 InputMethodBase::OnInputLocaleChanged(); |
| 131 } | 131 } |
| 132 | 132 |
| 133 std::string InputMethodLinuxX11::GetInputLocale() { | 133 std::string InputMethodLinuxX11::GetInputLocale() { |
| 134 return ""; | 134 return ""; |
| 135 } | 135 } |
| 136 | 136 |
| 137 base::i18n::TextDirection InputMethodLinuxX11::GetInputTextDirection() { | 137 base::i18n::TextDirection InputMethodLinuxX11::GetInputTextDirection() { |
| 138 return input_method_context_->GetInputTextDirection(); | 138 return input_method_context_->GetInputTextDirection(); |
| 139 } | 139 } |
| 140 | 140 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 TextInputClient* focused_before, | 177 TextInputClient* focused_before, |
| 178 TextInputClient* focused) { | 178 TextInputClient* focused) { |
| 179 input_method_context_->Reset(); | 179 input_method_context_->Reset(); |
| 180 input_method_context_->OnTextInputTypeChanged( | 180 input_method_context_->OnTextInputTypeChanged( |
| 181 focused ? focused->GetTextInputType() : TEXT_INPUT_TYPE_NONE); | 181 focused ? focused->GetTextInputType() : TEXT_INPUT_TYPE_NONE); |
| 182 | 182 |
| 183 InputMethodBase::OnDidChangeFocusedClient(focused_before, focused); | 183 InputMethodBase::OnDidChangeFocusedClient(focused_before, focused); |
| 184 } | 184 } |
| 185 | 185 |
| 186 } // namespace ui | 186 } // namespace ui |
| OLD | NEW |