1 // Copyright 2013 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. 4 5 #ifndef CHROMEOS_IME_FAKE_INPUT_METHOD_DELEGATE_H_ 6 #define CHROMEOS_IME_FAKE_INPUT_METHOD_DELEGATE_H_ 7 8 #include "base/basictypes.h" 9 #include "base/callback.h" 10 #include "base/compiler_specific.h" 11 #include "chromeos/chromeos_export.h" 12 #include "chromeos/ime/input_method_delegate.h" 13 14 namespace chromeos { 15 namespace input_method { 16 17 class CHROMEOS_EXPORT FakeInputMethodDelegate : public InputMethodDelegate { 18 public: 19 typedef base::Callback<string16 (const std::string& language_code)> 20 LanguageNameLocalizationCallback; 21 typedef base::Callback<string16 (int resource_id)> 22 GetLocalizedStringCallback; 23 24 FakeInputMethodDelegate(); 25 virtual ~FakeInputMethodDelegate(); 26 27 // InputMethodDelegate implementation: 28 virtual std::string GetHardwareKeyboardLayout() const OVERRIDE; 29 virtual string16 GetLocalizedString(int resource_id) const OVERRIDE; 30 virtual string16 GetDisplayLanguageName( 31 const std::string& language_code) const OVERRIDE; 32 33 void set_hardware_keyboard_layout(const std::string& value) { 34 hardware_keyboard_layout_ = value; 35 } 36 37 void set_active_locale(const std::string& value) { 38 active_locale_ = value; 39 } 40 41 void set_get_display_language_name_callback( 42 const LanguageNameLocalizationCallback& callback) { 43 get_display_language_name_callback_ = callback; 44 } 45 46 void set_get_localized_string_callback( 47 const GetLocalizedStringCallback& callback) { 48 get_localized_string_callback_ = callback; 49 } 50 51 private: 52 std::string hardware_keyboard_layout_; 53 std::string active_locale_; 54 LanguageNameLocalizationCallback get_display_language_name_callback_; 55 GetLocalizedStringCallback get_localized_string_callback_; 56 DISALLOW_COPY_AND_ASSIGN(FakeInputMethodDelegate); 57 }; 58 59 } // namespace input_method 60 } // namespace chromeos 61 62 #endif // CHROMEOS_IME_FAKE_INPUT_METHOD_DELEGATE_H_ 63