Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(298)

Side by Side Diff: chromeos/ime/fake_input_method_delegate.h

Issue 14200032: Decouple l10n_util from InputMethodUtil. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: /MockInputMethodDelegate/FakeInputMethodDelegate/ Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chromeos/chromeos.gyp ('k') | chromeos/ime/fake_input_method_delegate.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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_
OLDNEW
« no previous file with comments | « chromeos/chromeos.gyp ('k') | chromeos/ime/fake_input_method_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698