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

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

Issue 2290083002: The preedit view of the candidate window should be hidden correctly when the text input client does… (Closed)
Patch Set: Created 4 years, 3 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 | « chrome/browser/chromeos/input_method/candidate_window_controller_impl.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_chromeos.h" 5 #include "ui/base/ime/input_method_chromeos.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <cstring> 10 #include <cstring>
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after
450 // We need to receive input method result even if the text input type is 450 // We need to receive input method result even if the text input type is
451 // TEXT_INPUT_TYPE_NONE, to make sure we can always send correct 451 // TEXT_INPUT_TYPE_NONE, to make sure we can always send correct
452 // character for each key event to the focused text input client. 452 // character for each key event to the focused text input client.
453 if (!GetTextInputClient()) 453 if (!GetTextInputClient())
454 return; 454 return;
455 455
456 const base::string16 utf16_text = base::UTF8ToUTF16(text); 456 const base::string16 utf16_text = base::UTF8ToUTF16(text);
457 if (utf16_text.empty()) 457 if (utf16_text.empty())
458 return; 458 return;
459 459
460 if (!CanComposeInline()) {
461 // Hides the candidate window for preedit text.
462 UpdateCompositionText(CompositionText(), 0, false);
463 }
464
460 // Append the text to the buffer, because commit signal might be fired 465 // Append the text to the buffer, because commit signal might be fired
461 // multiple times when processing a key event. 466 // multiple times when processing a key event.
462 result_text_.append(utf16_text); 467 result_text_.append(utf16_text);
463 468
464 // If we are not handling key event, do not bother sending text result if the 469 // If we are not handling key event, do not bother sending text result if the
465 // focused text input client does not support text input. 470 // focused text input client does not support text input.
466 if (!handling_key_event_ && !IsTextInputTypeNone()) { 471 if (!handling_key_event_ && !IsTextInputTypeNone()) {
467 if (!SendFakeProcessKeyEvent(true)) 472 if (!SendFakeProcessKeyEvent(true))
468 GetTextInputClient()->InsertText(utf16_text); 473 GetTextInputClient()->InsertText(utf16_text);
469 SendFakeProcessKeyEvent(false); 474 SendFakeProcessKeyEvent(false);
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
637 bool InputMethodChromeOS::IsNonPasswordInputFieldFocused() { 642 bool InputMethodChromeOS::IsNonPasswordInputFieldFocused() {
638 TextInputType type = GetTextInputType(); 643 TextInputType type = GetTextInputType();
639 return (type != TEXT_INPUT_TYPE_NONE) && (type != TEXT_INPUT_TYPE_PASSWORD); 644 return (type != TEXT_INPUT_TYPE_NONE) && (type != TEXT_INPUT_TYPE_PASSWORD);
640 } 645 }
641 646
642 bool InputMethodChromeOS::IsInputFieldFocused() { 647 bool InputMethodChromeOS::IsInputFieldFocused() {
643 return GetTextInputType() != TEXT_INPUT_TYPE_NONE; 648 return GetTextInputType() != TEXT_INPUT_TYPE_NONE;
644 } 649 }
645 650
646 } // namespace ui 651 } // namespace ui
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/input_method/candidate_window_controller_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698