Updating trunk VERSION from 2139.0 to 2140.0
[chromium-blink-merge.git] / chromeos / ime / fake_ime_keyboard.cc
blobd4bd0e0bb6f1813e2100042bc02e0bde915e2fd5
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
3 // found in the LICENSE file.
5 #include "chromeos/ime/fake_ime_keyboard.h"
7 namespace chromeos {
8 namespace input_method {
10 FakeImeKeyboard::FakeImeKeyboard()
11 : set_current_keyboard_layout_by_name_count_(0),
12 caps_lock_is_enabled_(false),
13 auto_repeat_is_enabled_(false) {
16 FakeImeKeyboard::~FakeImeKeyboard() {
19 void FakeImeKeyboard::AddObserver(Observer* observer) {
20 observers_.AddObserver(observer);
23 void FakeImeKeyboard::RemoveObserver(Observer* observer) {
24 observers_.RemoveObserver(observer);
27 bool FakeImeKeyboard::SetCurrentKeyboardLayoutByName(
28 const std::string& layout_name) {
29 ++set_current_keyboard_layout_by_name_count_;
30 last_layout_ = layout_name;
31 return true;
34 bool FakeImeKeyboard::ReapplyCurrentKeyboardLayout() {
35 return true;
38 void FakeImeKeyboard::ReapplyCurrentModifierLockStatus() {
41 void FakeImeKeyboard::DisableNumLock() {
44 void FakeImeKeyboard::SetCapsLockEnabled(bool enable_caps_lock) {
45 bool old_state = caps_lock_is_enabled_;
46 caps_lock_is_enabled_ = enable_caps_lock;
47 if (old_state != enable_caps_lock) {
48 FOR_EACH_OBSERVER(ImeKeyboard::Observer, observers_,
49 OnCapsLockChanged(enable_caps_lock));
53 bool FakeImeKeyboard::CapsLockIsEnabled() {
54 return caps_lock_is_enabled_;
57 bool FakeImeKeyboard::IsISOLevel5ShiftAvailable() const {
58 return false;
61 bool FakeImeKeyboard::IsAltGrAvailable() const {
62 return false;
65 bool FakeImeKeyboard::SetAutoRepeatEnabled(bool enabled) {
66 auto_repeat_is_enabled_ = enabled;
67 return true;
70 bool FakeImeKeyboard::SetAutoRepeatRate(const AutoRepeatRate& rate) {
71 last_auto_repeat_rate_ = rate;
72 return true;
75 } // namespace input_method
76 } // namespace chromeos