| 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 599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 610 char16_offsets[end], | 610 char16_offsets[end], |
| 611 SK_ColorBLACK, | 611 SK_ColorBLACK, |
| 612 false /* thick */, | 612 false /* thick */, |
| 613 SK_ColorTRANSPARENT); | 613 SK_ColorTRANSPARENT); |
| 614 if (underline_attributes[i].type == | 614 if (underline_attributes[i].type == |
| 615 chromeos::CompositionText::COMPOSITION_TEXT_UNDERLINE_DOUBLE) | 615 chromeos::CompositionText::COMPOSITION_TEXT_UNDERLINE_DOUBLE) |
| 616 underline.thick = true; | 616 underline.thick = true; |
| 617 else if (underline_attributes[i].type == | 617 else if (underline_attributes[i].type == |
| 618 chromeos::CompositionText::COMPOSITION_TEXT_UNDERLINE_ERROR) | 618 chromeos::CompositionText::COMPOSITION_TEXT_UNDERLINE_ERROR) |
| 619 underline.color = SK_ColorRED; | 619 underline.color = SK_ColorRED; |
| 620 else if (underline_attributes[i].type == |
| 621 chromeos::CompositionText::COMPOSITION_TEXT_UNDERLINE_NONE) |
| 622 underline.color = SK_ColorTRANSPARENT; |
| 620 out_composition->underlines.push_back(underline); | 623 out_composition->underlines.push_back(underline); |
| 621 } | 624 } |
| 622 } | 625 } |
| 623 | 626 |
| 624 DCHECK(text.selection_start() <= text.selection_end()); | 627 DCHECK(text.selection_start() <= text.selection_end()); |
| 625 if (text.selection_start() < text.selection_end()) { | 628 if (text.selection_start() < text.selection_end()) { |
| 626 const uint32 start = text.selection_start(); | 629 const uint32 start = text.selection_start(); |
| 627 const uint32 end = text.selection_end(); | 630 const uint32 end = text.selection_end(); |
| 628 CompositionUnderline underline(char16_offsets[start], | 631 CompositionUnderline underline(char16_offsets[start], |
| 629 char16_offsets[end], | 632 char16_offsets[end], |
| (...skipping 20 matching lines...) Expand all Loading... |
| 650 0, length, SK_ColorBLACK, false /* thick */, SK_ColorTRANSPARENT)); | 653 0, length, SK_ColorBLACK, false /* thick */, SK_ColorTRANSPARENT)); |
| 651 } | 654 } |
| 652 } | 655 } |
| 653 | 656 |
| 654 bool InputMethodChromeOS::IsInputFieldFocused() { | 657 bool InputMethodChromeOS::IsInputFieldFocused() { |
| 655 TextInputType type = GetTextInputType(); | 658 TextInputType type = GetTextInputType(); |
| 656 return (type != TEXT_INPUT_TYPE_NONE) && (type != TEXT_INPUT_TYPE_PASSWORD); | 659 return (type != TEXT_INPUT_TYPE_NONE) && (type != TEXT_INPUT_TYPE_PASSWORD); |
| 657 } | 660 } |
| 658 | 661 |
| 659 } // namespace ui | 662 } // namespace ui |
| OLD | NEW |