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 CHROMEOS_IME_FAKE_INPUT_METHOD_DELEGATE_H_
6 #define CHROMEOS_IME_FAKE_INPUT_METHOD_DELEGATE_H_
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"
15 namespace input_method {
17 class CHROMEOS_EXPORT FakeInputMethodDelegate : public InputMethodDelegate {
19 typedef base::Callback<string16 (const std::string& language_code)>
20 LanguageNameLocalizationCallback;
21 typedef base::Callback<string16 (int resource_id)>
22 GetLocalizedStringCallback;
24 FakeInputMethodDelegate();
25 virtual ~FakeInputMethodDelegate();
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;
33 void set_hardware_keyboard_layout(const std::string& value) {
34 hardware_keyboard_layout_ = value;
37 void set_active_locale(const std::string& value) {
38 active_locale_ = value;
41 void set_get_display_language_name_callback(
42 const LanguageNameLocalizationCallback& callback) {
43 get_display_language_name_callback_ = callback;
46 void set_get_localized_string_callback(
47 const GetLocalizedStringCallback& callback) {
48 get_localized_string_callback_ = callback;
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);
59 } // namespace input_method
60 } // namespace chromeos
62 #endif // CHROMEOS_IME_FAKE_INPUT_METHOD_DELEGATE_H_