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

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

Issue 162723003: Migrate CandidateWindow::Entry to string16. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix browsertest compilation 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/base/ime/chromeos/mock_ime_candidate_window_handler.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 <algorithm> 7 #include <algorithm>
8 #include <cstring> 8 #include <cstring>
9 #include <set> 9 #include <set>
10 #include <vector> 10 #include <vector>
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after
489 const chromeos::CompositionText& text, 489 const chromeos::CompositionText& text,
490 uint32 cursor_pos, 490 uint32 cursor_pos,
491 bool visible) { 491 bool visible) {
492 if (IsTextInputTypeNone()) 492 if (IsTextInputTypeNone())
493 return; 493 return;
494 494
495 if (!CanComposeInline()) { 495 if (!CanComposeInline()) {
496 chromeos::IBusPanelCandidateWindowHandlerInterface* candidate_window = 496 chromeos::IBusPanelCandidateWindowHandlerInterface* candidate_window =
497 chromeos::IMEBridge::Get()->GetCandidateWindowHandler(); 497 chromeos::IMEBridge::Get()->GetCandidateWindowHandler();
498 if (candidate_window) 498 if (candidate_window)
499 candidate_window->UpdatePreeditText(text.text(), cursor_pos, visible); 499 candidate_window->UpdatePreeditText(
500 base::UTF8ToUTF16(text.text()), cursor_pos, visible);
500 } 501 }
501 502
502 // |visible| argument is very confusing. For example, what's the correct 503 // |visible| argument is very confusing. For example, what's the correct
503 // behavior when: 504 // behavior when:
504 // 1. OnUpdatePreeditText() is called with a text and visible == false, then 505 // 1. OnUpdatePreeditText() is called with a text and visible == false, then
505 // 2. OnShowPreeditText() is called afterwards. 506 // 2. OnShowPreeditText() is called afterwards.
506 // 507 //
507 // If it's only for clearing the current preedit text, then why not just use 508 // If it's only for clearing the current preedit text, then why not just use
508 // OnHidePreeditText()? 509 // OnHidePreeditText()?
509 if (!visible) { 510 if (!visible) {
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
643 } 644 }
644 645
645 // Use a black thin underline by default. 646 // Use a black thin underline by default.
646 if (out_composition->underlines.empty()) { 647 if (out_composition->underlines.empty()) {
647 out_composition->underlines.push_back(CompositionUnderline( 648 out_composition->underlines.push_back(CompositionUnderline(
648 0, length, SK_ColorBLACK, false /* thick */)); 649 0, length, SK_ColorBLACK, false /* thick */));
649 } 650 }
650 } 651 }
651 652
652 } // namespace ui 653 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/ime/chromeos/mock_ime_candidate_window_handler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698