Index: ui/events/ozone/layout/xkb/xkb_keyboard_layout_engine.h |
diff --git a/ui/events/ozone/layout/xkb/xkb_keyboard_layout_engine.h b/ui/events/ozone/layout/xkb/xkb_keyboard_layout_engine.h |
index d7a98545d3a435c884854f069798f9b72bcc1b4d..6a3006ec963681663a07848e3dbd8a7668c01aeb 100644 |
--- a/ui/events/ozone/layout/xkb/xkb_keyboard_layout_engine.h |
+++ b/ui/events/ozone/layout/xkb/xkb_keyboard_layout_engine.h |
@@ -5,9 +5,11 @@ |
#ifndef UI_EVENTS_OZONE_LAYOUT_XKB_XKB_KEYBOARD_LAYOUT_ENGINE_H_ |
#define UI_EVENTS_OZONE_LAYOUT_XKB_XKB_KEYBOARD_LAYOUT_ENGINE_H_ |
+#include <map> |
#include <xkbcommon/xkbcommon.h> |
#include "base/containers/hash_tables.h" |
+#include "base/memory/ref_counted.h" |
#include "base/memory/scoped_ptr.h" |
#include "base/strings/string16.h" |
#include "ui/events/ozone/layout/events_ozone_layout_export.h" |
@@ -86,6 +88,26 @@ class EVENTS_OZONE_LAYOUT_EXPORT XkbKeyboardLayoutEngine |
// so we need to trigger its cleanup. |
scoped_ptr<xkb_context, XkbContextDeleter> xkb_context_; |
scoped_ptr<xkb_state, XkbStateDeleter> xkb_state_; |
+ std::map<std::string, xkb_keymap*> xkb_keymaps_; |
+ |
+ // The class is used to load keymap files. |
+ class XkbKeymapLoader : public base::RefCountedThreadSafe<XkbKeymapLoader> { |
Shu Chen
2014/12/24 02:24:21
Usually we put inner class definition as the first
FengYuan
2014/12/26 02:42:20
Done.
|
+ public: |
+ explicit XkbKeymapLoader(XkbKeyboardLayoutEngine* layout_engine); |
+ void loadKeymap(const std::string& layout_name); |
+ |
+ private: |
+ friend class base::RefCountedThreadSafe<XkbKeymapLoader>; |
+ ~XkbKeymapLoader() {} |
+ XkbKeyboardLayoutEngine* layout_engine_; |
+ struct xkb_rule_names* names; |
+ // Uses xkb_keymap_new_from_names from libxkbcommon to load keymap file, |
+ // And pushes this keymap file load into FILE thread. |
+ void startLoadKeymap(const std::string& layout_name, |
+ xkb_rule_names* names); |
+ }; |
+ |
+ XkbKeymapLoader* keymap_loader_; |
Shu Chen
2014/12/24 02:24:21
Use scoped_ptr
FengYuan
2014/12/26 02:42:20
Done.
|
}; |
} // namespace ui |