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

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: Disabled EF_IME_FABRICATED_KEY flag on CrOS. Created 6 years, 7 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
« no previous file with comments | « ui/aura/window_targeter.cc ('k') | ui/events/event_constants.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 &&
60 (event.flags() & ui::EF_IME_FABRICATED_KEY) == 0) {
60 const ui::KeyEvent fabricated_event(ET_KEY_PRESSED, 61 const ui::KeyEvent fabricated_event(ET_KEY_PRESSED,
61 VKEY_PROCESSKEY, 62 VKEY_PROCESSKEY,
62 event.flags(), 63 event.flags(),
63 false); // is_char 64 false); // is_char
64 DispatchKeyEventPostIME(fabricated_event); 65 DispatchKeyEventPostIME(fabricated_event);
65 } 66 }
66 return true; 67 return true;
67 } 68 }
68 69
69 // Otherwise, insert the character. 70 // Otherwise, insert the character.
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 TextInputClient* focused_before, 147 TextInputClient* focused_before,
147 TextInputClient* focused) { 148 TextInputClient* focused) {
148 input_method_context_->Reset(); 149 input_method_context_->Reset();
149 input_method_context_->OnTextInputTypeChanged( 150 input_method_context_->OnTextInputTypeChanged(
150 focused ? focused->GetTextInputType() : TEXT_INPUT_TYPE_NONE); 151 focused ? focused->GetTextInputType() : TEXT_INPUT_TYPE_NONE);
151 152
152 InputMethodBase::OnDidChangeFocusedClient(focused_before, focused); 153 InputMethodBase::OnDidChangeFocusedClient(focused_before, focused);
153 } 154 }
154 155
155 } // namespace ui 156 } // namespace ui
OLDNEW
« no previous file with comments | « ui/aura/window_targeter.cc ('k') | ui/events/event_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698