| 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_ozone.h" | 5 #include "chromeos/ime/fake_ime_keyboard.h" |
| 6 #include "chromeos/ime/ime_keyboard.h" |
| 6 | 7 |
| 7 namespace chromeos { | 8 namespace chromeos { |
| 8 namespace input_method { | 9 namespace input_method { |
| 9 | 10 |
| 10 | |
| 11 ImeKeyboardOzone::ImeKeyboardOzone() | |
| 12 : set_current_keyboard_layout_by_name_count_(0), | |
| 13 caps_lock_is_enabled_(false), | |
| 14 auto_repeat_is_enabled_(false) { | |
| 15 } | |
| 16 | |
| 17 | |
| 18 ImeKeyboardOzone::~ImeKeyboardOzone() { | |
| 19 } | |
| 20 | |
| 21 bool ImeKeyboardOzone::SetCurrentKeyboardLayoutByName( | |
| 22 const std::string& layout_name) { | |
| 23 // Call SetKeyMapping here. | |
| 24 // TODO: parse out layout name and variation. | |
| 25 last_layout_ = layout_name; | |
| 26 return true; | |
| 27 } | |
| 28 | |
| 29 void ImeKeyboardOzone::ReapplyCurrentKeyboardLayout() { | |
| 30 SetCurrentKeyboardLayoutByName(last_layout_); | |
| 31 } | |
| 32 | |
| 33 void ImeKeyboardOzone::SetCapsLockEnabled(bool enable_caps_lock) { | |
| 34 // Call SetModifierStates here. | |
| 35 ImeKeyboard::SetCapsLockEnabled(enable_caps_lock); | |
| 36 } | |
| 37 | |
| 38 bool ImeKeyboardOzone::CapsLockIsEnabled() { | |
| 39 // Call getModifierStates here. | |
| 40 return false; | |
| 41 } | |
| 42 | |
| 43 void ImeKeyboardOzone::ReapplyCurrentModifierLockStatus() { | |
| 44 // call SetModifierStates here. | |
| 45 } | |
| 46 | |
| 47 void ImeKeyboardOzone::DisableNumLock() { | |
| 48 SetCapsLockEnabled(caps_lock_is_enabled_); | |
| 49 } | |
| 50 | |
| 51 bool ImeKeyboardOzone::SetAutoRepeatRate(const AutoRepeatRate& rate) { | |
| 52 return true; | |
| 53 } | |
| 54 | |
| 55 bool ImeKeyboardOzone::SetAutoRepeatEnabled(bool enabled) { | |
| 56 return true; | |
| 57 } | |
| 58 | |
| 59 // static | 11 // static |
| 60 ImeKeyboard* ImeKeyboard::Create() { | 12 ImeKeyboard* ImeKeyboard::Create() { |
| 61 return new ImeKeyboardOzone(); | 13 return new FakeImeKeyboard; |
| 62 } | 14 } |
| 63 | 15 |
| 64 } // namespace input_method | 16 } // namespace input_method |
| 65 } // namespace chromeos | 17 } // namespace chromeos |
| OLD | NEW |