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.
5 #ifndef UI_BASE_IME_CHROMEOS_FAKE_INPUT_METHOD_DELEGATE_H_
6 #define UI_BASE_IME_CHROMEOS_FAKE_INPUT_METHOD_DELEGATE_H_
10 #include "base/basictypes.h"
11 #include "base/callback.h"
12 #include "base/compiler_specific.h"
13 #include "ui/base/ime/chromeos/input_method_delegate.h"
14 #include "ui/base/ime/ui_base_ime_export.h"
17 namespace input_method
{
19 class UI_BASE_IME_EXPORT FakeInputMethodDelegate
: public InputMethodDelegate
{
21 typedef base::Callback
<base::string16 (const std::string
& language_code
)>
22 LanguageNameLocalizationCallback
;
23 typedef base::Callback
<base::string16 (int resource_id
)>
24 GetLocalizedStringCallback
;
26 FakeInputMethodDelegate();
27 ~FakeInputMethodDelegate() override
;
29 // InputMethodDelegate implementation:
30 std::string
GetHardwareKeyboardLayouts() const override
;
31 base::string16
GetLocalizedString(int resource_id
) const override
;
32 void SetHardwareKeyboardLayoutForTesting(const std::string
& layout
) override
;
33 base::string16
GetDisplayLanguageName(
34 const std::string
& language_code
) const override
;
36 void set_hardware_keyboard_layout(const std::string
& value
) {
37 hardware_keyboard_layout_
= value
;
40 void set_active_locale(const std::string
& value
) {
41 active_locale_
= value
;
44 void set_get_display_language_name_callback(
45 const LanguageNameLocalizationCallback
& callback
) {
46 get_display_language_name_callback_
= callback
;
49 void set_get_localized_string_callback(
50 const GetLocalizedStringCallback
& callback
) {
51 get_localized_string_callback_
= callback
;
55 std::string hardware_keyboard_layout_
;
56 std::string active_locale_
;
57 LanguageNameLocalizationCallback get_display_language_name_callback_
;
58 GetLocalizedStringCallback get_localized_string_callback_
;
59 DISALLOW_COPY_AND_ASSIGN(FakeInputMethodDelegate
);
62 } // namespace input_method
63 } // namespace chromeos
65 #endif // UI_BASE_IME_CHROMEOS_FAKE_INPUT_METHOD_DELEGATE_H_