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_auralinux.h" | 5 #include "ui/base/ime/input_method_auralinux.h" |
6 | 6 |
7 #include "base/environment.h" | 7 #include "base/environment.h" |
8 #include "ui/base/ime/linux/linux_input_method_context_factory.h" | 8 #include "ui/base/ime/linux/linux_input_method_context_factory.h" |
9 #include "ui/base/ime/text_input_client.h" | 9 #include "ui/base/ime/text_input_client.h" |
10 #include "ui/events/event.h" | 10 #include "ui/events/event.h" |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 } | 144 } |
145 | 145 |
146 bool InputMethodAuraLinux::IsCandidatePopupOpen() const { | 146 bool InputMethodAuraLinux::IsCandidatePopupOpen() const { |
147 // There seems no way to detect candidate windows or any popups. | 147 // There seems no way to detect candidate windows or any popups. |
148 return false; | 148 return false; |
149 } | 149 } |
150 | 150 |
151 // Overriden from ui::LinuxInputMethodContextDelegate | 151 // Overriden from ui::LinuxInputMethodContextDelegate |
152 | 152 |
153 void InputMethodAuraLinux::OnCommit(const base::string16& text) { | 153 void InputMethodAuraLinux::OnCommit(const base::string16& text) { |
154 TextInputClient* text_input_client = GetTextInputClient(); | 154 if (!IsTextInputTypeNone()) |
155 if (text_input_client) | 155 GetTextInputClient()->InsertText(text); |
156 text_input_client->InsertText(text); | |
157 } | 156 } |
158 | 157 |
159 void InputMethodAuraLinux::OnPreeditChanged( | 158 void InputMethodAuraLinux::OnPreeditChanged( |
160 const CompositionText& composition_text) { | 159 const CompositionText& composition_text) { |
161 TextInputClient* text_input_client = GetTextInputClient(); | 160 TextInputClient* text_input_client = GetTextInputClient(); |
162 if (text_input_client) | 161 if (text_input_client) |
163 text_input_client->SetCompositionText(composition_text); | 162 text_input_client->SetCompositionText(composition_text); |
164 } | 163 } |
165 | 164 |
166 void InputMethodAuraLinux::OnPreeditEnd() { | 165 void InputMethodAuraLinux::OnPreeditEnd() { |
(...skipping 10 matching lines...) Expand all Loading... |
177 TextInputClient* focused_before, | 176 TextInputClient* focused_before, |
178 TextInputClient* focused) { | 177 TextInputClient* focused) { |
179 input_method_context_->Reset(); | 178 input_method_context_->Reset(); |
180 input_method_context_->OnTextInputTypeChanged( | 179 input_method_context_->OnTextInputTypeChanged( |
181 focused ? focused->GetTextInputType() : TEXT_INPUT_TYPE_NONE); | 180 focused ? focused->GetTextInputType() : TEXT_INPUT_TYPE_NONE); |
182 | 181 |
183 InputMethodBase::OnDidChangeFocusedClient(focused_before, focused); | 182 InputMethodBase::OnDidChangeFocusedClient(focused_before, focused); |
184 } | 183 } |
185 | 184 |
186 } // namespace ui | 185 } // namespace ui |
OLD | NEW |