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

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

Issue 851853002: It is time. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Trying to reup because the last upload failed. Created 5 years, 11 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 | « ui/base/ime/input_method_minimal.h ('k') | ui/base/ime/input_method_observer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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.
4
5 #include "ui/base/ime/input_method_minimal.h"
6
7 #include "ui/base/ime/text_input_client.h"
8 #include "ui/events/event.h"
9 #include "ui/events/event_constants.h"
10
11 namespace ui {
12
13 InputMethodMinimal::InputMethodMinimal(
14 internal::InputMethodDelegate* delegate) {
15 SetDelegate(delegate);
16 }
17
18 InputMethodMinimal::~InputMethodMinimal() {}
19
20 bool InputMethodMinimal::OnUntranslatedIMEMessage(
21 const base::NativeEvent& event,
22 NativeEventResult* result) {
23 return false;
24 }
25
26 bool InputMethodMinimal::DispatchKeyEvent(const ui::KeyEvent& event) {
27 DCHECK(event.type() == ET_KEY_PRESSED || event.type() == ET_KEY_RELEASED);
28
29 // If no text input client, do nothing.
30 if (!GetTextInputClient())
31 return DispatchKeyEventPostIME(event);
32
33 // Insert the character.
34 const bool handled = DispatchKeyEventPostIME(event);
35 if (event.type() == ET_KEY_PRESSED && GetTextInputClient()) {
36 const uint16 ch = event.GetCharacter();
37 if (ch) {
38 GetTextInputClient()->InsertChar(ch, event.flags());
39 return true;
40 }
41 }
42 return handled;
43 }
44
45 void InputMethodMinimal::OnCaretBoundsChanged(const TextInputClient* client) {}
46
47 void InputMethodMinimal::CancelComposition(const TextInputClient* client) {}
48
49 void InputMethodMinimal::OnInputLocaleChanged() {}
50
51 std::string InputMethodMinimal::GetInputLocale() {
52 return std::string();
53 }
54
55 bool InputMethodMinimal::IsActive() {
56 return true;
57 }
58
59 bool InputMethodMinimal::IsCandidatePopupOpen() const {
60 return false;
61 }
62
63 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/ime/input_method_minimal.h ('k') | ui/base/ime/input_method_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698