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

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

Issue 277973002: Fixes the timing to dispatch VKEY_PROCESSKEY. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed nona's comments. 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 | « no previous file | ui/base/ime/input_method_auralinux.cc » ('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 #ifndef UI_BASE_IME_INPUT_METHOD_AURALINUX_H_ 5 #ifndef UI_BASE_IME_INPUT_METHOD_AURALINUX_H_
6 #define UI_BASE_IME_INPUT_METHOD_AURALINUX_H_ 6 #define UI_BASE_IME_INPUT_METHOD_AURALINUX_H_
7 7
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "ui/base/ime/input_method_base.h" 9 #include "ui/base/ime/input_method_base.h"
10 #include "ui/base/ime/linux/linux_input_method_context.h" 10 #include "ui/base/ime/linux/linux_input_method_context.h"
(...skipping 27 matching lines...) Expand all
38 virtual void OnPreeditChanged(const CompositionText& composition_text) 38 virtual void OnPreeditChanged(const CompositionText& composition_text)
39 OVERRIDE; 39 OVERRIDE;
40 virtual void OnPreeditEnd() OVERRIDE; 40 virtual void OnPreeditEnd() OVERRIDE;
41 virtual void OnPreeditStart() OVERRIDE; 41 virtual void OnPreeditStart() OVERRIDE;
42 42
43 protected: 43 protected:
44 // Overridden from InputMethodBase. 44 // Overridden from InputMethodBase.
45 virtual void OnDidChangeFocusedClient(TextInputClient* focused_before, 45 virtual void OnDidChangeFocusedClient(TextInputClient* focused_before,
46 TextInputClient* focused) OVERRIDE; 46 TextInputClient* focused) OVERRIDE;
47 47
48 private:
49 // Allows to fire a VKEY_PROCESSKEY key event.
50 void AllowToFireProcessKey(const ui::KeyEvent& event);
51 // Fires a VKEY_PROCESSKEY key event if allowed.
52 void MaybeFireProcessKey();
53 // Stops firing VKEY_PROCESSKEY key events.
54 void StopFiringProcessKey();
55
48 scoped_ptr<LinuxInputMethodContext> input_method_context_; 56 scoped_ptr<LinuxInputMethodContext> input_method_context_;
49 57
58 // IBus in async mode eagerly consumes all the key events first regardless of
59 // whether the underlying IME consumes the key event or not, and makes
60 // gtk_im_context_filter_keypress() always return true, and later pushes
61 // the key event back to the GDK event queue when it turns out that the
62 // underlying IME doesn't consume the key event.
63 //
64 // Thus we have to defer a decision whether or not to dispatch a
65 // VKEY_PROCESSKEY key event. Unlike other InputMethod's subclasses,
66 // DispatchKeyEvent() in this class does not directly dispatch a
67 // VKEY_PROCESSKEY event, OnCommit or OnPreedit{Start,Changed,End} dispatch
68 // a VKEY_PROCESSKEY event instead.
69 //
70 // Because of this hack, there could be chances that we accidentally dispatch
71 // VKEY_PROCESSKEY events and other key events in out of order.
72 //
73 // |allowed_to_fire_vkey_process_key_| is used not to dispatch a
74 // VKEY_PROCESSKEY event twice for a single key event.
75 bool allowed_to_fire_vkey_process_key_;
76 int vkey_processkey_flags_;
77
50 DISALLOW_COPY_AND_ASSIGN(InputMethodAuraLinux); 78 DISALLOW_COPY_AND_ASSIGN(InputMethodAuraLinux);
51 }; 79 };
52 80
53 } // namespace ui 81 } // namespace ui
54 82
55 #endif // UI_BASE_IME_INPUT_METHOD_AURALINUX_H_ 83 #endif // UI_BASE_IME_INPUT_METHOD_AURALINUX_H_
OLDNEW
« no previous file with comments | « no previous file | ui/base/ime/input_method_auralinux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698