summaryrefslogtreecommitdiffstats
path: root/chromeos/ime/mock_xkeyboard.cc
diff options
context:
space:
mode:
authornona@chromium.org <nona@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-30 18:58:16 +0000
committernona@chromium.org <nona@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-30 18:58:16 +0000
commitda5cb8050d674ff048770411522628f66d99a297 (patch)
tree3165562799bfb893d4dab9c5480290d8d0c2e931 /chromeos/ime/mock_xkeyboard.cc
parent43156477fa536cb65ff52bd5ba3ea52c73fd333f (diff)
downloadchromium_src-da5cb8050d674ff048770411522628f66d99a297.zip
chromium_src-da5cb8050d674ff048770411522628f66d99a297.tar.gz
chromium_src-da5cb8050d674ff048770411522628f66d99a297.tar.bz2
Move xkeyboard.cc from c/b/chromeos/input_method to chromeos/ime
BUG=164375 TEST=None TBR=sky Review URL: https://chromiumcodereview.appspot.com/12672008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@191535 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chromeos/ime/mock_xkeyboard.cc')
-rw-r--r--chromeos/ime/mock_xkeyboard.cc67
1 files changed, 67 insertions, 0 deletions
diff --git a/chromeos/ime/mock_xkeyboard.cc b/chromeos/ime/mock_xkeyboard.cc
new file mode 100644
index 0000000..a4a2f72
--- /dev/null
+++ b/chromeos/ime/mock_xkeyboard.cc
@@ -0,0 +1,67 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chromeos/ime/mock_xkeyboard.h"
+
+namespace chromeos {
+namespace input_method {
+
+MockXKeyboard::MockXKeyboard()
+ : set_current_keyboard_layout_by_name_count_(0),
+ caps_lock_is_enabled_(false),
+ num_lock_is_enabled_(false) {
+}
+
+bool MockXKeyboard::SetCurrentKeyboardLayoutByName(
+ const std::string& layout_name) {
+ ++set_current_keyboard_layout_by_name_count_;
+ last_layout_ = layout_name;
+ return true;
+}
+
+bool MockXKeyboard::ReapplyCurrentKeyboardLayout() {
+ return true;
+}
+
+void MockXKeyboard::ReapplyCurrentModifierLockStatus() {
+}
+
+void MockXKeyboard::SetLockedModifiers(ModifierLockStatus new_caps_lock_status,
+ ModifierLockStatus new_num_lock_status) {
+ if (new_caps_lock_status != kDontChange) {
+ caps_lock_is_enabled_ =
+ (new_caps_lock_status == kEnableLock) ? true : false;
+ }
+ if (new_num_lock_status != kDontChange)
+ num_lock_is_enabled_ = (new_num_lock_status == kEnableLock) ? true : false;
+}
+
+void MockXKeyboard::SetNumLockEnabled(bool enable_num_lock) {
+ num_lock_is_enabled_ = enable_num_lock;
+}
+
+void MockXKeyboard::SetCapsLockEnabled(bool enable_caps_lock) {
+ caps_lock_is_enabled_ = enable_caps_lock;
+}
+
+bool MockXKeyboard::NumLockIsEnabled() {
+ return num_lock_is_enabled_;
+}
+
+bool MockXKeyboard::CapsLockIsEnabled() {
+ return caps_lock_is_enabled_;
+}
+
+unsigned int MockXKeyboard::GetNumLockMask() {
+ return 1;
+}
+
+void MockXKeyboard::GetLockedModifiers(bool* out_caps_lock_enabled,
+ bool* out_num_lock_enabled) {
+ *out_caps_lock_enabled = caps_lock_is_enabled_;
+ *out_num_lock_enabled = num_lock_is_enabled_;
+}
+
+} // namespace input_method
+} // namespace chromeos