| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |