Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(387)

Side by Side Diff: chromeos/ime/extension_ime_util.h

Issue 178343005: [IME] migrate the xkb ID to extension based xkb ID. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 CHROMEOS_IME_EXTENSION_IME_UTIL_H_ 5 #ifndef CHROMEOS_IME_EXTENSION_IME_UTIL_H_
6 #define CHROMEOS_IME_EXTENSION_IME_UTIL_H_ 6 #define CHROMEOS_IME_EXTENSION_IME_UTIL_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "chromeos/chromeos_export.h" 10 #include "chromeos/chromeos_export.h"
(...skipping 14 matching lines...) Expand all
25 // nor |engine_id| is really a member of |extension_id|. 25 // nor |engine_id| is really a member of |extension_id|.
26 std::string CHROMEOS_EXPORT GetComponentInputMethodID( 26 std::string CHROMEOS_EXPORT GetComponentInputMethodID(
27 const std::string& extension_id, 27 const std::string& extension_id,
28 const std::string& engine_id); 28 const std::string& engine_id);
29 29
30 // Returns extension ID if |input_method_id| is extension IME ID or component 30 // Returns extension ID if |input_method_id| is extension IME ID or component
31 // extension IME ID. Otherwise returns an empty string (""). 31 // extension IME ID. Otherwise returns an empty string ("").
32 std::string CHROMEOS_EXPORT GetExtensionIDFromInputMethodID( 32 std::string CHROMEOS_EXPORT GetExtensionIDFromInputMethodID(
33 const std::string& input_method_id); 33 const std::string& input_method_id);
34 34
35 // Returns InputMethodID from keyboard layout (xkb) id (e.g. xkb:fr:fra).
36 const std::string CHROMEOS_EXPORT GetInputMethodIDByKeyboardLayout(
Yuki 2014/03/04 04:04:45 const in |const std::string| is meaningless. If y
Shu Chen 2014/03/04 04:45:02 Done.
37 const std::string& keyboard_layout_id);
38
35 // Returns true if |input_method_id| is extension IME ID. This function does not 39 // Returns true if |input_method_id| is extension IME ID. This function does not
36 // check |input_method_id| is installed extension IME. 40 // check |input_method_id| is installed extension IME.
37 bool CHROMEOS_EXPORT IsExtensionIME(const std::string& input_method_id); 41 bool CHROMEOS_EXPORT IsExtensionIME(const std::string& input_method_id);
38 42
39 // Returns true if |input_method_id| is component extension IME ID. This 43 // Returns true if |input_method_id| is component extension IME ID. This
40 // function does not check |input_method_id| is really whitelisted one or not. 44 // function does not check |input_method_id| is really whitelisted one or not.
41 // If you want to check |input_method_id| is whitelisted component extension 45 // If you want to check |input_method_id| is whitelisted component extension
42 // IME, please use ComponentExtensionIMEManager::IsWhitelisted instead. 46 // IME, please use ComponentExtensionIMEManager::IsWhitelisted instead.
43 bool CHROMEOS_EXPORT IsComponentExtensionIME( 47 bool CHROMEOS_EXPORT IsComponentExtensionIME(
44 const std::string& input_method_id); 48 const std::string& input_method_id);
45 49
46 // Returns true if the |input_method| is a member of |extension_id| of extension 50 // Returns true if the |input_method| is a member of |extension_id| of extension
47 // IME, otherwise returns false. 51 // IME, otherwise returns false.
48 bool CHROMEOS_EXPORT IsMemberOfExtension(const std::string& input_method_id, 52 bool CHROMEOS_EXPORT IsMemberOfExtension(const std::string& input_method_id,
49 const std::string& extension_id); 53 const std::string& extension_id);
50 54
51 // Returns true if the |input_method_id| is the extension based xkb keyboard, 55 // Returns true if the |input_method_id| is the extension based xkb keyboard,
52 // otherwise returns false. 56 // otherwise returns false.
53 bool CHROMEOS_EXPORT IsKeyboardLayoutExtension( 57 bool CHROMEOS_EXPORT IsKeyboardLayoutExtension(
54 const std::string& input_method_id); 58 const std::string& input_method_id);
55 59
60 // Returns true to use the wrapped extension keyboards instead of the legacy
61 // xkb keyboards, returns false otherwise.
62 bool CHROMEOS_EXPORT UseWrappedExtensionKeyboardLayouts();
63
64 // Sets true to forcibly let UseWrappedExtensionKeyboardLayouts() function
65 // return true for testing purpose, sets false to restore.
66 // Returns the original flag value.
67 bool CHROMEOS_EXPORT SetUseWrappedExtensionKeyboardLayoutsFlagForTesting(
Yuki 2014/03/04 04:04:45 Please consider to make this a class named ScopedF
Shu Chen 2014/03/04 04:45:02 Done.
68 bool enabled);
69
70 // Gets legacy xkb id (e.g. xkb:us::eng) from the new extension based xkb id
71 // (e.g. _comp_ime_...xkb:us::eng). If the given id is not prefixed with
72 // 'xkb:', just return the same as the given id.
73 const std::string CHROMEOS_EXPORT MaybeGetLegacyXkbId(
Yuki 2014/03/04 04:04:45 Ditto for const in |const std::string|.
Shu Chen 2014/03/04 04:45:02 Done.
74 const std::string& input_method_id);
75
56 } // namespace extension_ime_util 76 } // namespace extension_ime_util
57 77
58 } // namespace chromeos 78 } // namespace chromeos
59 79
60 #endif // CHROMEOS_IME_EXTENSION_IME_UTIL_H_ 80 #endif // CHROMEOS_IME_EXTENSION_IME_UTIL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698