OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/chromeos/input_method/input_method_engine.h" | 5 #include "chrome/browser/chromeos/input_method/input_method_engine.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #undef FocusIn | 9 #undef FocusIn |
10 #undef FocusOut | 10 #undef FocusOut |
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
337 case MENU_ITEM_STYLE_SEPARATOR: | 337 case MENU_ITEM_STYLE_SEPARATOR: |
338 // TODO(nona): Implement it. | 338 // TODO(nona): Implement it. |
339 break; | 339 break; |
340 } | 340 } |
341 } | 341 } |
342 } | 342 } |
343 | 343 |
344 // TODO(nona): Support item.children. | 344 // TODO(nona): Support item.children. |
345 } | 345 } |
346 | 346 |
| 347 void InputMethodEngine::UpdateComposition( |
| 348 const ui::CompositionText& composition_text, |
| 349 uint32_t cursor_pos, |
| 350 bool is_visible) { |
| 351 ui::IMEInputContextHandlerInterface* input_context = |
| 352 ui::IMEBridge::Get()->GetInputContextHandler(); |
| 353 if (input_context) |
| 354 input_context->UpdateCompositionText(composition_text, cursor_pos, |
| 355 is_visible); |
| 356 } |
| 357 |
| 358 void InputMethodEngine::CommitTextToInputContext(int context_id, |
| 359 const std::string& text) { |
| 360 ui::IMEBridge::Get()->GetInputContextHandler()->CommitText(text); |
| 361 |
| 362 // Records histograms for committed characters. |
| 363 if (!composition_text_->text.empty()) { |
| 364 base::string16 wtext = base::UTF8ToUTF16(text); |
| 365 UMA_HISTOGRAM_CUSTOM_COUNTS("InputMethod.CommitLength", wtext.length(), 1, |
| 366 25, 25); |
| 367 composition_text_.reset(new ui::CompositionText()); |
| 368 } |
| 369 } |
| 370 |
347 } // namespace chromeos | 371 } // namespace chromeos |
OLD | NEW |