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

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

Issue 243143002: linux-aura: Supports Compose key with XIM. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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 | Annotate | Revision Log
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 "ui/base/ime/input_method_auralinux.h" 5 #include "ui/base/ime/input_method_auralinux.h"
6 6
7 #include "base/environment.h" 7 #include "base/environment.h"
8 #include "ui/base/ime/linux/linux_input_method_context_factory.h" 8 #include "ui/base/ime/linux/linux_input_method_context_factory.h"
9 #include "ui/base/ime/text_input_client.h" 9 #include "ui/base/ime/text_input_client.h"
10 #include "ui/events/event.h" 10 #include "ui/events/event.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 bool InputMethodAuraLinux::DispatchKeyEvent(const ui::KeyEvent& event) { 49 bool InputMethodAuraLinux::DispatchKeyEvent(const ui::KeyEvent& event) {
50 DCHECK(event.type() == ET_KEY_PRESSED || event.type() == ET_KEY_RELEASED); 50 DCHECK(event.type() == ET_KEY_PRESSED || event.type() == ET_KEY_RELEASED);
51 DCHECK(system_toplevel_window_focused()); 51 DCHECK(system_toplevel_window_focused());
52 52
53 // If no text input client, do nothing. 53 // If no text input client, do nothing.
54 if (!GetTextInputClient()) 54 if (!GetTextInputClient())
55 return DispatchKeyEventPostIME(event); 55 return DispatchKeyEventPostIME(event);
56 56
57 // Let an IME handle the key event first. 57 // Let an IME handle the key event first.
58 if (input_method_context_->DispatchKeyEvent(event)) { 58 if (input_method_context_->DispatchKeyEvent(event)) {
59 if (event.type() == ET_KEY_PRESSED) { 59 if (event.type() == ET_KEY_PRESSED && !event.is_fabricated_by_ime()) {
60 const ui::KeyEvent fabricated_event(ET_KEY_PRESSED, 60 const ui::KeyEvent fabricated_event(ET_KEY_PRESSED,
61 VKEY_PROCESSKEY, 61 VKEY_PROCESSKEY,
62 event.flags(), 62 event.flags(),
63 false); // is_char 63 false); // is_char
64 DispatchKeyEventPostIME(fabricated_event); 64 DispatchKeyEventPostIME(fabricated_event);
65 } 65 }
66 return true; 66 return true;
67 } 67 }
68 68
69 // Otherwise, insert the character. 69 // Otherwise, insert the character.
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 TextInputClient* focused_before, 146 TextInputClient* focused_before,
147 TextInputClient* focused) { 147 TextInputClient* focused) {
148 input_method_context_->Reset(); 148 input_method_context_->Reset();
149 input_method_context_->OnTextInputTypeChanged( 149 input_method_context_->OnTextInputTypeChanged(
150 focused ? focused->GetTextInputType() : TEXT_INPUT_TYPE_NONE); 150 focused ? focused->GetTextInputType() : TEXT_INPUT_TYPE_NONE);
151 151
152 InputMethodBase::OnDidChangeFocusedClient(focused_before, focused); 152 InputMethodBase::OnDidChangeFocusedClient(focused_before, focused);
153 } 153 }
154 154
155 } // namespace ui 155 } // namespace ui
OLDNEW
« no previous file with comments | « ui/aura/window_targeter.cc ('k') | ui/events/event.h » ('j') | ui/events/event.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698