Chromium Code Reviews| Index: chrome/browser/ui/libgtk2ui/x11_input_method_context_impl_gtk2.h |
| diff --git a/chrome/browser/ui/libgtk2ui/x11_input_method_context_impl_gtk2.h b/chrome/browser/ui/libgtk2ui/x11_input_method_context_impl_gtk2.h |
| index fe87ef5a6f3b1f41d043670c7c19bef8e8943cf7..bfae1d7f99fd3aad3eb96c6e5bac91a48aa1dc28 100644 |
| --- a/chrome/browser/ui/libgtk2ui/x11_input_method_context_impl_gtk2.h |
| +++ b/chrome/browser/ui/libgtk2ui/x11_input_method_context_impl_gtk2.h |
| @@ -27,14 +27,15 @@ namespace libgtk2ui { |
| class X11InputMethodContextImplGtk2 : public ui::LinuxInputMethodContext { |
| public: |
| explicit X11InputMethodContextImplGtk2( |
|
yukawa
2015/04/08 22:26:48
nit: we can drop "explicit".
Shu Chen
2015/04/09 01:16:32
Done.
|
| - ui::LinuxInputMethodContextDelegate* delegate); |
| + ui::LinuxInputMethodContextDelegate* delegate, bool is_simple); |
| ~X11InputMethodContextImplGtk2() override; |
| // Overriden from ui::LinuxInputMethodContext |
| bool DispatchKeyEvent(const ui::KeyEvent& key_event) override; |
| + void SetCursorLocation(const gfx::Rect& rect) override; |
| void Reset() override; |
| - void OnTextInputTypeChanged(ui::TextInputType text_input_type) override; |
| - void OnCaretBoundsChanged(const gfx::Rect& caret_bounds) override; |
| + void Focus() override; |
| + void Blur() override; |
| private: |
| // Resets the cache of X modifier keycodes. |
| @@ -70,17 +71,9 @@ class X11InputMethodContextImplGtk2 : public ui::LinuxInputMethodContext { |
| // A set of callback functions. Must not be NULL. |
| ui::LinuxInputMethodContextDelegate* delegate_; |
| - // IME's input context used for TEXT_INPUT_TYPE_NONE and |
| - // TEXT_INPUT_TYPE_PASSWORD. |
| - GtkIMContext* gtk_context_simple_; |
| - // IME's input context used for the other text input types. |
| - GtkIMContext* gtk_multicontext_; |
| - |
| - // An alias to |gtk_context_simple_| or |gtk_multicontext_| depending on the |
| - // text input type. Can be NULL when it's not focused. |
| + // IME's input GTK context. |
| GtkIMContext* gtk_context_; |
| - // Last set client window. |
| GdkWindow* gdk_last_set_client_window_; |
| // Last known caret bounds relative to the screen coordinates. |
| @@ -94,46 +87,6 @@ class X11InputMethodContextImplGtk2 : public ui::LinuxInputMethodContext { |
| std::vector<int> super_keycodes_; |
| std::vector<int> hyper_keycodes_; |
| - // The helper class to trap GTK+'s "commit" signal for direct input key |
| - // events. |
| - // |
| - // gtk_im_context_filter_keypress() emits "commit" signal in order to insert |
| - // a character which is not actually processed by a IME. This behavior seems, |
| - // in Javascript world, that a keydown event with keycode = VKEY_PROCESSKEY |
| - // (= 229) is fired. So we have to trap such "commit" signal for direct input |
| - // key events. This class helps to trap such events. |
| - class GtkCommitSignalTrap { |
| - public: |
| - GtkCommitSignalTrap(); |
| - |
| - // Enables the trap which monitors a direct input key event of |keyval|. |
| - void StartTrap(guint keyval); |
| - |
| - // Disables the trap. |
| - void StopTrap(); |
| - |
| - // Checks if the committed |text| has come from a direct input key event, |
| - // and returns true in that case. Once it's trapped, IsSignalCaught() |
| - // returns true. |
| - // Must be called at most once between StartTrap() and StopTrap(). |
| - bool Trap(const base::string16& text); |
| - |
| - // Returns true if a direct input key event is detected. |
| - bool IsSignalCaught() const { return is_signal_caught_; } |
| - |
| - private: |
| - bool is_trap_enabled_; |
| - guint gdk_event_key_keyval_; |
| - bool is_signal_caught_; |
| - |
| - DISALLOW_COPY_AND_ASSIGN(GtkCommitSignalTrap); |
| - }; |
| - |
| - GtkCommitSignalTrap commit_signal_trap_; |
| - |
| - FRIEND_TEST_ALL_PREFIXES(X11InputMethodContextImplGtk2FriendTest, |
| - GtkCommitSignalTrap); |
| - |
| DISALLOW_COPY_AND_ASSIGN(X11InputMethodContextImplGtk2); |
| }; |