Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(25)

Side by Side Diff: ui/base/ime/input_method_auralinux.cc

Issue 1257003002: OnPreeditChanged should update the internal composition after checking it. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | ui/base/ime/input_method_auralinux_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/environment.h" 8 #include "base/environment.h"
9 #include "ui/base/ime/linux/linux_input_method_context_factory.h" 9 #include "ui/base/ime/linux/linux_input_method_context_factory.h"
10 #include "ui/base/ime/text_input_client.h" 10 #include "ui/base/ime/text_input_client.h"
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 GetTextInputClient()->InsertText(text); 236 GetTextInputClient()->InsertText(text);
237 composition_.Clear(); 237 composition_.Clear();
238 } 238 }
239 } 239 }
240 240
241 void InputMethodAuraLinux::OnPreeditChanged( 241 void InputMethodAuraLinux::OnPreeditChanged(
242 const CompositionText& composition_text) { 242 const CompositionText& composition_text) {
243 if (suppress_next_result_ || IsTextInputTypeNone()) 243 if (suppress_next_result_ || IsTextInputTypeNone())
244 return; 244 return;
245 245
246 composition_ = composition_text;
247
248 if (is_sync_mode_) { 246 if (is_sync_mode_) {
249 if (!composition_.text.empty() || !composition_text.text.empty()) 247 if (!composition_.text.empty() || !composition_text.text.empty())
250 composition_changed_ = true; 248 composition_changed_ = true;
251 } else { 249 } else {
252 SendFakeProcessKeyEvent(0); 250 SendFakeProcessKeyEvent(0);
253 GetTextInputClient()->SetCompositionText(composition_text); 251 GetTextInputClient()->SetCompositionText(composition_text);
254 } 252 }
253
254 composition_ = composition_text;
255 } 255 }
256 256
257 void InputMethodAuraLinux::OnPreeditEnd() { 257 void InputMethodAuraLinux::OnPreeditEnd() {
258 if (suppress_next_result_ || IsTextInputTypeNone()) 258 if (suppress_next_result_ || IsTextInputTypeNone())
259 return; 259 return;
260 260
261 if (is_sync_mode_) { 261 if (is_sync_mode_) {
262 if (!composition_.text.empty()) { 262 if (!composition_.text.empty()) {
263 composition_.Clear(); 263 composition_.Clear();
264 composition_changed_ = true; 264 composition_changed_ = true;
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 324
325 void InputMethodAuraLinux::ConfirmCompositionText() { 325 void InputMethodAuraLinux::ConfirmCompositionText() {
326 TextInputClient* client = GetTextInputClient(); 326 TextInputClient* client = GetTextInputClient();
327 if (client && client->HasCompositionText()) 327 if (client && client->HasCompositionText())
328 client->ConfirmCompositionText(); 328 client->ConfirmCompositionText();
329 329
330 ResetContext(); 330 ResetContext();
331 } 331 }
332 332
333 } // namespace ui 333 } // namespace ui
OLDNEW
« no previous file with comments | « no previous file | ui/base/ime/input_method_auralinux_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698