Chromium Code Reviews| Index: chromeos/ime/extension_ime_util.h |
| diff --git a/chromeos/ime/extension_ime_util.h b/chromeos/ime/extension_ime_util.h |
| index bdcc896c631f321bd0bc72a315d2183e04c39c2d..03532d4fc37c402b2ac2f419eb155e93148da30b 100644 |
| --- a/chromeos/ime/extension_ime_util.h |
| +++ b/chromeos/ime/extension_ime_util.h |
| @@ -7,6 +7,7 @@ |
| #include <string> |
| +#include "base/auto_reset.h" |
| #include "chromeos/chromeos_export.h" |
| namespace chromeos { |
| @@ -32,6 +33,10 @@ std::string CHROMEOS_EXPORT GetComponentInputMethodID( |
| std::string CHROMEOS_EXPORT GetExtensionIDFromInputMethodID( |
| const std::string& input_method_id); |
| +// Returns InputMethodID from keyboard layout (xkb) id (e.g. xkb:fr:fra). |
| +std::string CHROMEOS_EXPORT GetInputMethodIDByKeyboardLayout( |
| + const std::string& keyboard_layout_id); |
| + |
| // Returns true if |input_method_id| is extension IME ID. This function does not |
| // check |input_method_id| is installed extension IME. |
| bool CHROMEOS_EXPORT IsExtensionIME(const std::string& input_method_id); |
| @@ -53,6 +58,25 @@ bool CHROMEOS_EXPORT IsMemberOfExtension(const std::string& input_method_id, |
| bool CHROMEOS_EXPORT IsKeyboardLayoutExtension( |
| const std::string& input_method_id); |
| +// Returns true to use the wrapped extension keyboards instead of the legacy |
| +// xkb keyboards, returns false otherwise. |
| +bool CHROMEOS_EXPORT UseWrappedExtensionKeyboardLayouts(); |
| + |
| +// Gets legacy xkb id (e.g. xkb:us::eng) from the new extension based xkb id |
| +// (e.g. _comp_ime_...xkb:us::eng). If the given id is not prefixed with |
| +// 'xkb:', just return the same as the given id. |
| +std::string CHROMEOS_EXPORT MaybeGetLegacyXkbId( |
| + const std::string& input_method_id); |
| + |
| +// The scoped class to temporarily set the flag to use extension based xkb |
| +// keyboards for testing. |
| +class CHROMEOS_EXPORT ScopedUseExtensionKeyboardFlagForTesting { |
| + public: |
| + explicit ScopedUseExtensionKeyboardFlagForTesting(bool newFlag); |
|
Yuki
2014/03/04 05:57:28
nit: s/newFlag/new_flag/
Shu Chen
2014/03/04 06:43:38
Done.
|
| + private: |
|
Yuki
2014/03/04 05:57:28
nit: better to put an empty line just before priva
Shu Chen
2014/03/04 06:43:38
Done.
|
| + base::AutoReset<bool> auto_reset_; |
| +}; |
| + |
| } // namespace extension_ime_util |
| } // namespace chromeos |