| 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..13fb11536edfe1c344809fbde82690042430066e 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
|
| @@ -26,15 +26,16 @@ namespace libgtk2ui {
|
| // and uses GtkIMContext(gtk-immodule) as a bridge from/to underlying IMEs.
|
| class X11InputMethodContextImplGtk2 : public ui::LinuxInputMethodContext {
|
| public:
|
| - explicit X11InputMethodContextImplGtk2(
|
| - ui::LinuxInputMethodContextDelegate* delegate);
|
| + X11InputMethodContextImplGtk2(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);
|
| };
|
|
|
|
|