Chromium Code Reviews| 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 CHROMEOS_IME_XKEYBOARD_H_ | 5 #ifndef CHROMEOS_IME_KEYBOARD_CONTROLLER_H_ |
| 6 #define CHROMEOS_IME_XKEYBOARD_H_ | 6 #define CHROMEOS_IME_KEYBOARD_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "chromeos/chromeos_export.h" | 12 #include "chromeos/chromeos_export.h" |
| 13 | 13 |
| 14 namespace chromeos { | 14 namespace chromeos { |
| 15 namespace input_method { | 15 namespace input_method { |
| 16 | 16 |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 27 kVoidKey, | 27 kVoidKey, |
| 28 kCapsLockKey, | 28 kCapsLockKey, |
| 29 kEscapeKey, | 29 kEscapeKey, |
| 30 // IMPORTANT: You should update kCustomizableKeys[] in .cc file, if you | 30 // IMPORTANT: You should update kCustomizableKeys[] in .cc file, if you |
| 31 // add a customizable key. | 31 // add a customizable key. |
| 32 kNumModifierKeys, | 32 kNumModifierKeys, |
| 33 }; | 33 }; |
| 34 | 34 |
| 35 class InputMethodUtil; | 35 class InputMethodUtil; |
| 36 | 36 |
| 37 class CHROMEOS_EXPORT XKeyboard { | 37 class CHROMEOS_EXPORT KeyboardController { |
|
sadrul
2014/04/10 00:16:57
There's a KeyboardController in ui/keyboard/. Can
spang
2014/04/10 00:18:47
Happy to bikeshed.
IMEKeyboardController?
NonVir
| |
| 38 public: | 38 public: |
| 39 virtual ~XKeyboard() {} | 39 virtual ~KeyboardController() {} |
| 40 | 40 |
| 41 // Sets the current keyboard layout to |layout_name|. This function does not | 41 // Sets the current keyboard layout to |layout_name|. This function does not |
| 42 // change the current mapping of the modifier keys. Returns true on success. | 42 // change the current mapping of the modifier keys. Returns true on success. |
| 43 virtual bool SetCurrentKeyboardLayoutByName( | 43 virtual bool SetCurrentKeyboardLayoutByName( |
| 44 const std::string& layout_name) = 0; | 44 const std::string& layout_name) = 0; |
| 45 | 45 |
| 46 // Sets the current keyboard layout again. We have to call the function every | 46 // Sets the current keyboard layout again. We have to call the function every |
| 47 // time when "XI_HierarchyChanged" XInput2 event is sent to Chrome. See | 47 // time when "XI_HierarchyChanged" XInput2 event is sent to Chrome. See |
| 48 // xinput_hierarchy_changed_event_listener.h for details. | 48 // xinput_hierarchy_changed_event_listener.h for details. |
| 49 virtual bool ReapplyCurrentKeyboardLayout() = 0; | 49 virtual bool ReapplyCurrentKeyboardLayout() = 0; |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 92 // On success, set current auto repeat rate on |out_rate| and returns true. | 92 // On success, set current auto repeat rate on |out_rate| and returns true. |
| 93 // Returns false otherwise. This function is protected: for testability. | 93 // Returns false otherwise. This function is protected: for testability. |
| 94 static CHROMEOS_EXPORT bool GetAutoRepeatRateForTesting( | 94 static CHROMEOS_EXPORT bool GetAutoRepeatRateForTesting( |
| 95 AutoRepeatRate* out_rate); | 95 AutoRepeatRate* out_rate); |
| 96 | 96 |
| 97 // Returns false if |layout_name| contains a bad character. | 97 // Returns false if |layout_name| contains a bad character. |
| 98 static CHROMEOS_EXPORT bool CheckLayoutNameForTesting( | 98 static CHROMEOS_EXPORT bool CheckLayoutNameForTesting( |
| 99 const std::string& layout_name); | 99 const std::string& layout_name); |
| 100 | 100 |
| 101 // Note: At this moment, classes other than InputMethodManager should not | 101 // Note: At this moment, classes other than InputMethodManager should not |
| 102 // instantiate the XKeyboard class. | 102 // instantiate the KeyboardController class. |
| 103 static XKeyboard* Create(); | 103 static KeyboardController* Create(); |
| 104 }; | 104 }; |
| 105 | 105 |
| 106 } // namespace input_method | 106 } // namespace input_method |
| 107 } // namespace chromeos | 107 } // namespace chromeos |
| 108 | 108 |
| 109 #endif // CHROMEOS_IME_XKEYBOARD_H_ | 109 #endif // CHROMEOS_IME_KEYBOARD_CONTROLLER_H_ |
| OLD | NEW |