| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CHROME_BROWSER_CHROMEOS_INPUT_METHOD_MOCK_XKEYBOARD_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_INPUT_METHOD_MOCK_XKEYBOARD_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_INPUT_METHOD_MOCK_XKEYBOARD_H_ | 6 #define CHROME_BROWSER_CHROMEOS_INPUT_METHOD_MOCK_XKEYBOARD_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "chrome/browser/chromeos/input_method/xkeyboard.h" | 9 #include "chrome/browser/chromeos/input_method/xkeyboard.h" |
| 10 | 10 |
| 11 #include <string> | 11 #include <string> |
| 12 | 12 |
| 13 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
| 14 | 14 |
| 15 namespace chromeos { | 15 namespace chromeos { |
| 16 namespace input_method { | 16 namespace input_method { |
| 17 | 17 |
| 18 class MockXKeyboard : public XKeyboard { | 18 class MockXKeyboard : public XKeyboard { |
| 19 public: | 19 public: |
| 20 MockXKeyboard(); | 20 MockXKeyboard(); |
| 21 virtual ~MockXKeyboard() {} | 21 virtual ~MockXKeyboard() {} |
| 22 | 22 |
| 23 virtual bool SetCurrentKeyboardLayoutByName( | 23 virtual bool SetCurrentKeyboardLayoutByName( |
| 24 const std::string& layout_name) OVERRIDE; | 24 const std::string& layout_name) OVERRIDE; |
| 25 virtual bool RemapModifierKeys(const ModifierMap& modifier_map) OVERRIDE; | |
| 26 virtual bool ReapplyCurrentKeyboardLayout() OVERRIDE; | 25 virtual bool ReapplyCurrentKeyboardLayout() OVERRIDE; |
| 27 virtual void ReapplyCurrentModifierLockStatus() OVERRIDE; | 26 virtual void ReapplyCurrentModifierLockStatus() OVERRIDE; |
| 28 virtual void SetLockedModifiers( | 27 virtual void SetLockedModifiers( |
| 29 ModifierLockStatus new_caps_lock_status, | 28 ModifierLockStatus new_caps_lock_status, |
| 30 ModifierLockStatus new_num_lock_status) OVERRIDE; | 29 ModifierLockStatus new_num_lock_status) OVERRIDE; |
| 31 virtual void SetNumLockEnabled(bool enable_num_lock) OVERRIDE; | 30 virtual void SetNumLockEnabled(bool enable_num_lock) OVERRIDE; |
| 32 virtual void SetCapsLockEnabled(bool enable_caps_lock) OVERRIDE; | 31 virtual void SetCapsLockEnabled(bool enable_caps_lock) OVERRIDE; |
| 33 virtual bool NumLockIsEnabled() OVERRIDE; | 32 virtual bool NumLockIsEnabled() OVERRIDE; |
| 34 virtual bool CapsLockIsEnabled() OVERRIDE; | 33 virtual bool CapsLockIsEnabled() OVERRIDE; |
| 35 virtual std::string CreateFullXkbLayoutName( | 34 virtual std::string CreateFullXkbLayoutName( |
| 36 const std::string& layout_name, | 35 const std::string& layout_name) OVERRIDE; |
| 37 const ModifierMap& modifire_map) OVERRIDE; | |
| 38 virtual unsigned int GetNumLockMask() OVERRIDE; | 36 virtual unsigned int GetNumLockMask() OVERRIDE; |
| 39 virtual void GetLockedModifiers(bool* out_caps_lock_enabled, | 37 virtual void GetLockedModifiers(bool* out_caps_lock_enabled, |
| 40 bool* out_num_lock_enabled) OVERRIDE; | 38 bool* out_num_lock_enabled) OVERRIDE; |
| 41 | 39 |
| 42 int set_current_keyboard_layout_by_name_count_; | 40 int set_current_keyboard_layout_by_name_count_; |
| 43 std::string last_layout_; | 41 std::string last_layout_; |
| 44 bool caps_lock_is_enabled_; | 42 bool caps_lock_is_enabled_; |
| 45 bool num_lock_is_enabled_; | 43 bool num_lock_is_enabled_; |
| 46 // TODO(yusukes): Add more variables for counting the numbers of the API calls | 44 // TODO(yusukes): Add more variables for counting the numbers of the API calls |
| 47 | 45 |
| 48 private: | 46 private: |
| 49 DISALLOW_COPY_AND_ASSIGN(MockXKeyboard); | 47 DISALLOW_COPY_AND_ASSIGN(MockXKeyboard); |
| 50 }; | 48 }; |
| 51 | 49 |
| 52 // TODO(yusukes): Use the mock in ui/views/ash/caps_lock_handler_browsertest.cc. | 50 // TODO(yusukes): Use the mock in ui/views/ash/caps_lock_handler_browsertest.cc. |
| 53 | 51 |
| 54 } // namespace input_method | 52 } // namespace input_method |
| 55 } // namespace chromeos | 53 } // namespace chromeos |
| 56 | 54 |
| 57 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_MOCK_XKEYBOARD_H_ | 55 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_MOCK_XKEYBOARD_H_ |
| OLD | NEW |