Add ICU message format support
[chromium-blink-merge.git] / ui / base / ime / input_method_minimal.cc
blobcd00702111f7b10b81d8f32304c96c727d80314c
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
3 // found in the LICENSE file.
5 #include "ui/base/ime/input_method_minimal.h"
7 #include "ui/base/ime/text_input_client.h"
8 #include "ui/events/event.h"
9 #include "ui/events/event_constants.h"
11 namespace ui {
13 InputMethodMinimal::InputMethodMinimal(
14 internal::InputMethodDelegate* delegate) {
15 SetDelegate(delegate);
18 InputMethodMinimal::~InputMethodMinimal() {}
20 bool InputMethodMinimal::OnUntranslatedIMEMessage(
21 const base::NativeEvent& event,
22 NativeEventResult* result) {
23 return false;
26 void InputMethodMinimal::DispatchKeyEvent(ui::KeyEvent* event) {
27 DCHECK(event->type() == ET_KEY_PRESSED || event->type() == ET_KEY_RELEASED);
29 // If no text input client, do nothing.
30 if (!GetTextInputClient()) {
31 ignore_result(DispatchKeyEventPostIME(event));
32 return;
35 // Insert the character.
36 ignore_result(DispatchKeyEventPostIME(event));
37 if (event->type() == ET_KEY_PRESSED && GetTextInputClient()) {
38 const uint16 ch = event->GetCharacter();
39 if (ch) {
40 GetTextInputClient()->InsertChar(ch, event->flags());
41 event->StopPropagation();
46 void InputMethodMinimal::OnCaretBoundsChanged(const TextInputClient* client) {}
48 void InputMethodMinimal::CancelComposition(const TextInputClient* client) {}
50 void InputMethodMinimal::OnInputLocaleChanged() {}
52 std::string InputMethodMinimal::GetInputLocale() {
53 return std::string();
56 bool InputMethodMinimal::IsCandidatePopupOpen() const {
57 return false;
60 } // namespace ui