| OLD | NEW |
| 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 CHROME_BROWSER_UI_LIBGTK2UI_X11_INPUT_METHOD_CONTEXT_IMPL_GTK2_H_ | 5 #ifndef CHROME_BROWSER_UI_LIBGTK2UI_X11_INPUT_METHOD_CONTEXT_IMPL_GTK2_H_ |
| 6 #define CHROME_BROWSER_UI_LIBGTK2UI_X11_INPUT_METHOD_CONTEXT_IMPL_GTK2_H_ | 6 #define CHROME_BROWSER_UI_LIBGTK2UI_X11_INPUT_METHOD_CONTEXT_IMPL_GTK2_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/containers/hash_tables.h" | 10 #include "base/containers/hash_tables.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 | 24 |
| 25 // An implementation of LinuxInputMethodContext which is based on X11 event loop | 25 // An implementation of LinuxInputMethodContext which is based on X11 event loop |
| 26 // and uses GtkIMContext(gtk-immodule) as a bridge from/to underlying IMEs. | 26 // and uses GtkIMContext(gtk-immodule) as a bridge from/to underlying IMEs. |
| 27 class X11InputMethodContextImplGtk2 : public ui::LinuxInputMethodContext { | 27 class X11InputMethodContextImplGtk2 : public ui::LinuxInputMethodContext { |
| 28 public: | 28 public: |
| 29 explicit X11InputMethodContextImplGtk2( | 29 explicit X11InputMethodContextImplGtk2( |
| 30 ui::LinuxInputMethodContextDelegate* delegate); | 30 ui::LinuxInputMethodContextDelegate* delegate); |
| 31 virtual ~X11InputMethodContextImplGtk2(); | 31 virtual ~X11InputMethodContextImplGtk2(); |
| 32 | 32 |
| 33 // Overriden from ui::LinuxInputMethodContext | 33 // Overriden from ui::LinuxInputMethodContext |
| 34 virtual bool DispatchKeyEvent(const ui::KeyEvent& key_event) OVERRIDE; | 34 virtual bool DispatchKeyEvent(const ui::KeyEvent& key_event) override; |
| 35 virtual void Reset() OVERRIDE; | 35 virtual void Reset() override; |
| 36 virtual void OnTextInputTypeChanged(ui::TextInputType text_input_type) | 36 virtual void OnTextInputTypeChanged(ui::TextInputType text_input_type) |
| 37 OVERRIDE; | 37 override; |
| 38 virtual void OnCaretBoundsChanged(const gfx::Rect& caret_bounds) OVERRIDE; | 38 virtual void OnCaretBoundsChanged(const gfx::Rect& caret_bounds) override; |
| 39 | 39 |
| 40 private: | 40 private: |
| 41 // Resets the cache of X modifier keycodes. | 41 // Resets the cache of X modifier keycodes. |
| 42 // TODO(yukishiino): We should call this method whenever X keyboard mapping | 42 // TODO(yukishiino): We should call this method whenever X keyboard mapping |
| 43 // changes, for example when a user switched to another keyboard layout. | 43 // changes, for example when a user switched to another keyboard layout. |
| 44 void ResetXModifierKeycodesCache(); | 44 void ResetXModifierKeycodesCache(); |
| 45 | 45 |
| 46 // Constructs a GdkEventKey from a XKeyEvent and returns it. Otherwise, | 46 // Constructs a GdkEventKey from a XKeyEvent and returns it. Otherwise, |
| 47 // returns NULL. The returned GdkEvent must be freed by gdk_event_free. | 47 // returns NULL. The returned GdkEvent must be freed by gdk_event_free. |
| 48 GdkEvent* GdkEventFromNativeEvent(const base::NativeEvent& native_event); | 48 GdkEvent* GdkEventFromNativeEvent(const base::NativeEvent& native_event); |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 | 134 |
| 135 FRIEND_TEST_ALL_PREFIXES(X11InputMethodContextImplGtk2FriendTest, | 135 FRIEND_TEST_ALL_PREFIXES(X11InputMethodContextImplGtk2FriendTest, |
| 136 GtkCommitSignalTrap); | 136 GtkCommitSignalTrap); |
| 137 | 137 |
| 138 DISALLOW_COPY_AND_ASSIGN(X11InputMethodContextImplGtk2); | 138 DISALLOW_COPY_AND_ASSIGN(X11InputMethodContextImplGtk2); |
| 139 }; | 139 }; |
| 140 | 140 |
| 141 } // namespace libgtk2ui | 141 } // namespace libgtk2ui |
| 142 | 142 |
| 143 #endif // CHROME_BROWSER_UI_LIBGTK2UI_X11_INPUT_METHOD_CONTEXT_IMPL_GTK2_H_ | 143 #endif // CHROME_BROWSER_UI_LIBGTK2UI_X11_INPUT_METHOD_CONTEXT_IMPL_GTK2_H_ |
| OLD | NEW |