OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "chromeos/ime/ime_keyboard.h" | 5 #include "chromeos/ime/ime_keyboard.h" |
6 | 6 |
7 #include <cstdlib> | 7 #include <cstdlib> |
8 #include <cstring> | 8 #include <cstring> |
9 #include <queue> | 9 #include <queue> |
10 #include <set> | 10 #include <set> |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 | 108 |
109 return true; | 109 return true; |
110 } | 110 } |
111 | 111 |
112 class ImeKeyboardX11 : public ImeKeyboard { | 112 class ImeKeyboardX11 : public ImeKeyboard { |
113 public: | 113 public: |
114 ImeKeyboardX11(); | 114 ImeKeyboardX11(); |
115 virtual ~ImeKeyboardX11() {} | 115 virtual ~ImeKeyboardX11() {} |
116 | 116 |
117 // Adds/removes observer. | 117 // Adds/removes observer. |
118 virtual void AddObserver(Observer* observer) OVERRIDE; | 118 virtual void AddObserver(Observer* observer) override; |
119 virtual void RemoveObserver(Observer* observer) OVERRIDE; | 119 virtual void RemoveObserver(Observer* observer) override; |
120 | 120 |
121 // ImeKeyboard: | 121 // ImeKeyboard: |
122 virtual bool SetCurrentKeyboardLayoutByName( | 122 virtual bool SetCurrentKeyboardLayoutByName( |
123 const std::string& layout_name) OVERRIDE; | 123 const std::string& layout_name) override; |
124 virtual bool ReapplyCurrentKeyboardLayout() OVERRIDE; | 124 virtual bool ReapplyCurrentKeyboardLayout() override; |
125 virtual void ReapplyCurrentModifierLockStatus() OVERRIDE; | 125 virtual void ReapplyCurrentModifierLockStatus() override; |
126 virtual void DisableNumLock() OVERRIDE; | 126 virtual void DisableNumLock() override; |
127 virtual void SetCapsLockEnabled(bool enable_caps_lock) OVERRIDE; | 127 virtual void SetCapsLockEnabled(bool enable_caps_lock) override; |
128 virtual bool CapsLockIsEnabled() OVERRIDE; | 128 virtual bool CapsLockIsEnabled() override; |
129 virtual bool IsISOLevel5ShiftAvailable() const OVERRIDE; | 129 virtual bool IsISOLevel5ShiftAvailable() const override; |
130 virtual bool IsAltGrAvailable() const OVERRIDE; | 130 virtual bool IsAltGrAvailable() const override; |
131 virtual bool SetAutoRepeatEnabled(bool enabled) OVERRIDE; | 131 virtual bool SetAutoRepeatEnabled(bool enabled) override; |
132 virtual bool SetAutoRepeatRate(const AutoRepeatRate& rate) OVERRIDE; | 132 virtual bool SetAutoRepeatRate(const AutoRepeatRate& rate) override; |
133 | 133 |
134 private: | 134 private: |
135 // Returns a mask for Num Lock (e.g. 1U << 4). Returns 0 on error. | 135 // Returns a mask for Num Lock (e.g. 1U << 4). Returns 0 on error. |
136 unsigned int GetNumLockMask(); | 136 unsigned int GetNumLockMask(); |
137 | 137 |
138 // Sets the caps-lock status. Note that calling this function always disables | 138 // Sets the caps-lock status. Note that calling this function always disables |
139 // the num-lock. | 139 // the num-lock. |
140 void SetLockedModifiers(bool caps_lock_enabled); | 140 void SetLockedModifiers(bool caps_lock_enabled); |
141 | 141 |
142 // This function is used by SetLayout() and RemapModifierKeys(). Calls | 142 // This function is used by SetLayout() and RemapModifierKeys(). Calls |
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
454 // static | 454 // static |
455 bool ImeKeyboard::CheckLayoutNameForTesting(const std::string& layout_name) { | 455 bool ImeKeyboard::CheckLayoutNameForTesting(const std::string& layout_name) { |
456 return CheckLayoutName(layout_name); | 456 return CheckLayoutName(layout_name); |
457 } | 457 } |
458 | 458 |
459 // static | 459 // static |
460 ImeKeyboard* ImeKeyboard::Create() { return new ImeKeyboardX11(); } | 460 ImeKeyboard* ImeKeyboard::Create() { return new ImeKeyboardX11(); } |
461 | 461 |
462 } // namespace input_method | 462 } // namespace input_method |
463 } // namespace chromeos | 463 } // namespace chromeos |
OLD | NEW |