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

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

Issue 639103003: Support invisible underline for IME composition. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nit. Created 6 years, 2 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 | « chromeos/ime/composition_text.h ('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 599 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « chromeos/ime/composition_text.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698