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

Side by Side Diff: chrome/browser/chromeos/input_method/input_method_engine.cc

Issue 1657593007: Implement chrome.input.ime.setComposition/commitText API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use Xxx::Results::Create(). Created 4 years, 10 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
OLDNEW
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
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
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/input_method/input_method_engine.h ('k') | chrome/browser/extensions/api/input_ime/input_ime_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698