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

Unified Diff: chrome/browser/chromeos/input_method/input_method_util.h

Issue 139803010: Support comma separated hardware keyboard layout. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix wrong condition. Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/input_method/input_method_util.h
diff --git a/chrome/browser/chromeos/input_method/input_method_util.h b/chrome/browser/chromeos/input_method/input_method_util.h
index 50092b456a93b389ca348095a887ea885ef3cbd0..a89ebd73398b0d1158d6c201275c503d03606177 100644
--- a/chrome/browser/chromeos/input_method/input_method_util.h
+++ b/chrome/browser/chromeos/input_method/input_method_util.h
@@ -13,6 +13,7 @@
#include "base/containers/hash_tables.h"
#include "base/memory/scoped_ptr.h"
#include "base/strings/string16.h"
+#include "base/threading/thread_checker.h"
#include "chromeos/ime/input_method_descriptor.h"
namespace chromeos {
@@ -97,12 +98,24 @@ class InputMethodUtil {
// Returns empty string on error.
std::string GetLanguageDefaultInputMethodId(const std::string& language_code);
- // Returns the input method ID of the hardware keyboard. e.g. "xkb:us::eng"
- // for the US Qwerty keyboard.
- std::string GetHardwareInputMethodId() const;
+ // Updates the internal cache of hardware layouts.
+ void UpdateHardwareLayoutCache();
- // Returns the login-allowed input method ID of the hardware keyboard.
- std::string GetHardwareLoginInputMethodId() const;
+ // Set hardware keyboard layout for testing purpose. This is for simulating
+ // "keyboard_layout" entry in VPD values.
+ void SetHardwareKeyboardLayoutForTesting(const std::string& layout);
+
+ // Fills the input method IDs of the hardware keyboard. e.g. "xkb:us::eng"
+ // for US Qwerty keyboard or "xkb:ru::rus" for Russian keyboard.
+ const std::vector<std::string>& GetHardwareInputMethodIds();
+
+ // Returns the login-allowed input method ID of the hardware keyboard, e.g.
+ // "xkb:us::eng" but not include non-login keyboard like "xkb:ru::rus". Please
+ // note that this is not a subset of returned value of
+ // GetHardwareInputMethodIds. If GetHardwareInputMethodIds returns only
+ // non-login keyboard, this function will returns "xkb:us::eng" as the
+ // fallback keyboard.
+ const std::vector<std::string>& GetHardwareLoginInputMethodIds();
// Returns true if given input method can be used to input login data.
bool IsLoginKeyboard(const std::string& input_method_id) const;
@@ -173,6 +186,10 @@ class InputMethodUtil {
InputMethodDelegate* delegate_;
+ base::ThreadChecker thread_checker_;
+ std::vector<std::string> hardware_layouts_;
+ std::vector<std::string> hardware_login_layouts_;
+
DISALLOW_COPY_AND_ASSIGN(InputMethodUtil);
};

Powered by Google App Engine
This is Rietveld 408576698