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

Unified Diff: ui/base/ime/input_method_chromeos.cc

Issue 163023002: Use base::string16 for CompositionText.Text instead of converting to utf-8 and back unnecessarily. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix unit test compile Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chromeos/ime/composition_text_unittest.cc ('k') | ui/base/ime/input_method_chromeos_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/ime/input_method_chromeos.cc
diff --git a/ui/base/ime/input_method_chromeos.cc b/ui/base/ime/input_method_chromeos.cc
index 61333310fb3c50b08985af0488d1f53776d2b1a1..e1c728da42a2eda8d342ef5abe651ac41374beb9 100644
--- a/ui/base/ime/input_method_chromeos.cc
+++ b/ui/base/ime/input_method_chromeos.cc
@@ -496,8 +496,7 @@ void InputMethodChromeOS::UpdateCompositionText(
chromeos::IBusPanelCandidateWindowHandlerInterface* candidate_window =
chromeos::IMEBridge::Get()->GetCandidateWindowHandler();
if (candidate_window)
- candidate_window->UpdatePreeditText(
- base::UTF8ToUTF16(text.text()), cursor_pos, visible);
+ candidate_window->UpdatePreeditText(text.text(), cursor_pos, visible);
}
// |visible| argument is very confusing. For example, what's the correct
@@ -560,8 +559,7 @@ bool InputMethodChromeOS::ExecuteCharacterComposer(const ui::KeyEvent& event) {
// CharacterComposer consumed the key event. Update the composition text.
chromeos::CompositionText preedit;
- preedit.set_text(
- base::UTF16ToUTF8(character_composer_.preedit_string()));
+ preedit.set_text(character_composer_.preedit_string());
UpdateCompositionText(preedit, preedit.text().size(),
!preedit.text().empty());
std::string commit_text =
@@ -577,7 +575,7 @@ void InputMethodChromeOS::ExtractCompositionText(
uint32 cursor_position,
CompositionText* out_composition) const {
out_composition->Clear();
- out_composition->text = base::UTF8ToUTF16(text.text());
+ out_composition->text = text.text();
if (out_composition->text.empty())
return;
« no previous file with comments | « chromeos/ime/composition_text_unittest.cc ('k') | ui/base/ime/input_method_chromeos_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698