OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "views/ime/input_method_wayland.h" | 5 #include "views/ime/input_method_wayland.h" |
6 | 6 |
7 #include "views/widget/widget.h" | 7 #include "views/widget/widget.h" |
8 | 8 |
9 namespace views { | 9 namespace views { |
10 | 10 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 // change. | 61 // change. |
62 if (old_focused_view != focused_view()) | 62 if (old_focused_view != focused_view()) |
63 return; | 63 return; |
64 | 64 |
65 // If a key event was not filtered by |context_| or |context_simple_|, then | 65 // If a key event was not filtered by |context_| or |context_simple_|, then |
66 // it means the key event didn't generate any result text. For some cases, | 66 // it means the key event didn't generate any result text. For some cases, |
67 // the key event may still generate a valid character, eg. a control-key | 67 // the key event may still generate a valid character, eg. a control-key |
68 // event (ctrl-a, return, tab, etc.). We need to send the character to the | 68 // event (ctrl-a, return, tab, etc.). We need to send the character to the |
69 // focused text input client by calling TextInputClient::InsertChar(). | 69 // focused text input client by calling TextInputClient::InsertChar(). |
70 char16 ch = key.GetCharacter(); | 70 char16 ch = key.GetCharacter(); |
71 ui::TextInputClient* client = GetTextInputClient(); | 71 TextInputClient* client = GetTextInputClient(); |
72 if (ch && client) | 72 if (ch && client) |
73 client->InsertChar(ch, key.flags()); | 73 client->InsertChar(ch, key.flags()); |
74 } | 74 } |
75 | 75 |
76 } // namespace views | 76 } // namespace views |
OLD | NEW |