| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "chrome/browser/ui/input_method/input_method_engine_base.h" | 5 #include "chrome/browser/ui/input_method/input_method_engine_base.h" |
| 6 | 6 |
| 7 #undef FocusIn | 7 #undef FocusIn |
| 8 #undef FocusOut | 8 #undef FocusOut |
| 9 #undef RootWindow | 9 #undef RootWindow |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 break; | 242 break; |
| 243 default: | 243 default: |
| 244 continue; | 244 continue; |
| 245 } | 245 } |
| 246 | 246 |
| 247 underline.start_offset = segment->start; | 247 underline.start_offset = segment->start; |
| 248 underline.end_offset = segment->end; | 248 underline.end_offset = segment->end; |
| 249 composition_text_->underlines.push_back(underline); | 249 composition_text_->underlines.push_back(underline); |
| 250 } | 250 } |
| 251 | 251 |
| 252 // Use a black thin underline by default. |
| 253 if (composition_text_->underlines.empty()) { |
| 254 composition_text_->underlines.push_back(ui::CompositionUnderline( |
| 255 0, composition_text_->text.length(), SK_ColorBLACK, false /* thick */, |
| 256 SK_ColorTRANSPARENT)); |
| 257 } |
| 258 |
| 252 // TODO(nona): Makes focus out mode configuable, if necessary. | 259 // TODO(nona): Makes focus out mode configuable, if necessary. |
| 253 UpdateComposition(*composition_text_, composition_cursor_, true); | 260 UpdateComposition(*composition_text_, composition_cursor_, true); |
| 254 return true; | 261 return true; |
| 255 } | 262 } |
| 256 | 263 |
| 257 bool InputMethodEngineBase::ClearComposition(int context_id, | 264 bool InputMethodEngineBase::ClearComposition(int context_id, |
| 258 std::string* error) { | 265 std::string* error) { |
| 259 if (!IsActive()) { | 266 if (!IsActive()) { |
| 260 *error = kErrorNotActive; | 267 *error = kErrorNotActive; |
| 261 return false; | 268 return false; |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 395 void InputMethodEngineBase::SetSurroundingText(const std::string& text, | 402 void InputMethodEngineBase::SetSurroundingText(const std::string& text, |
| 396 uint32_t cursor_pos, | 403 uint32_t cursor_pos, |
| 397 uint32_t anchor_pos, | 404 uint32_t anchor_pos, |
| 398 uint32_t offset_pos) { | 405 uint32_t offset_pos) { |
| 399 observer_->OnSurroundingTextChanged( | 406 observer_->OnSurroundingTextChanged( |
| 400 active_component_id_, text, static_cast<int>(cursor_pos), | 407 active_component_id_, text, static_cast<int>(cursor_pos), |
| 401 static_cast<int>(anchor_pos), static_cast<int>(offset_pos)); | 408 static_cast<int>(anchor_pos), static_cast<int>(offset_pos)); |
| 402 } | 409 } |
| 403 | 410 |
| 404 } // namespace input_method | 411 } // namespace input_method |
| OLD | NEW |