OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 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 CHROMEOS_IME_MOCK_INPUT_METHOD_DELEGATE_H_ | 5 #ifndef CHROMEOS_IME_MOCK_INPUT_METHOD_DELEGATE_H_ |
6 #define CHROMEOS_IME_MOCK_INPUT_METHOD_DELEGATE_H_ | 6 #define CHROMEOS_IME_MOCK_INPUT_METHOD_DELEGATE_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/callback.h" | |
9 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
10 #include "chromeos/chromeos_export.h" | 11 #include "chromeos/chromeos_export.h" |
11 #include "chromeos/ime/input_method_delegate.h" | 12 #include "chromeos/ime/input_method_delegate.h" |
12 | 13 |
13 namespace chromeos { | 14 namespace chromeos { |
14 namespace input_method { | 15 namespace input_method { |
15 | 16 |
16 class CHROMEOS_EXPORT MockInputMethodDelegate : public InputMethodDelegate { | 17 class CHROMEOS_EXPORT MockInputMethodDelegate : public InputMethodDelegate { |
satorux1
2013/04/18 06:09:26
Rename this to FakeInputMethodDelegate? This class
Seigo Nonaka
2013/04/18 11:50:59
Sure, Done.
On 2013/04/18 06:09:26, satorux1 wrote
| |
17 public: | 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 | |
18 MockInputMethodDelegate(); | 24 MockInputMethodDelegate(); |
19 virtual ~MockInputMethodDelegate(); | 25 virtual ~MockInputMethodDelegate(); |
20 | 26 |
21 // InputMethodDelegate implementation: | 27 // InputMethodDelegate implementation: |
22 virtual std::string GetHardwareKeyboardLayout() const OVERRIDE; | 28 virtual std::string GetHardwareKeyboardLayout() const OVERRIDE; |
23 virtual std::string GetActiveLocale() const OVERRIDE; | 29 virtual string16 GetLocalizedString(int resource_id) const OVERRIDE; |
30 virtual string16 GetDisplayLanguageName( | |
31 const std::string& language_code) const OVERRIDE; | |
24 | 32 |
25 void set_hardware_keyboard_layout(const std::string& value) { | 33 void set_hardware_keyboard_layout(const std::string& value) { |
26 hardware_keyboard_layout_ = value; | 34 hardware_keyboard_layout_ = value; |
27 } | 35 } |
28 | 36 |
29 void set_active_locale(const std::string& value) { | 37 void set_active_locale(const std::string& value) { |
30 active_locale_ = value; | 38 active_locale_ = value; |
31 } | 39 } |
32 | 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 | |
33 private: | 51 private: |
34 std::string hardware_keyboard_layout_; | 52 std::string hardware_keyboard_layout_; |
35 std::string active_locale_; | 53 std::string active_locale_; |
54 LanguageNameLocalizationCallback get_display_language_name_callback_; | |
55 GetLocalizedStringCallback get_localized_string_callback_; | |
36 DISALLOW_COPY_AND_ASSIGN(MockInputMethodDelegate); | 56 DISALLOW_COPY_AND_ASSIGN(MockInputMethodDelegate); |
37 }; | 57 }; |
38 | 58 |
39 } // namespace input_method | 59 } // namespace input_method |
40 } // namespace chromeos | 60 } // namespace chromeos |
41 | 61 |
42 #endif // CHROMEOS_IME_MOCK_INPUT_METHOD_DELEGATE_H_ | 62 #endif // CHROMEOS_IME_MOCK_INPUT_METHOD_DELEGATE_H_ |
OLD | NEW |