OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "ui/base/ime/input_method_factory.h" | 5 #include "ui/base/ime/input_method_factory.h" |
6 | 6 |
7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
8 #include "ui/base/ime/mock_input_method.h" | 8 #include "ui/base/ime/mock_input_method.h" |
9 | 9 |
10 #if defined(OS_CHROMEOS) | 10 #if defined(OS_CHROMEOS) |
11 #include "ui/base/ime/input_method_chromeos.h" | 11 #include "ui/base/ime/input_method_chromeos.h" |
12 #elif defined(OS_WIN) | 12 #elif defined(OS_WIN) |
13 #include "ui/base/ime/input_method_win.h" | 13 #include "ui/base/ime/input_method_win.h" |
14 #include "ui/base/ime/remote_input_method_win.h" | |
15 #elif defined(OS_MACOSX) | 14 #elif defined(OS_MACOSX) |
16 #include "ui/base/ime/input_method_mac.h" | 15 #include "ui/base/ime/input_method_mac.h" |
17 #elif defined(USE_AURA) && defined(OS_LINUX) && defined(USE_X11) && \ | 16 #elif defined(USE_AURA) && defined(OS_LINUX) && defined(USE_X11) && \ |
18 !defined(OS_CHROMEOS) | 17 !defined(OS_CHROMEOS) |
19 #include "ui/base/ime/input_method_auralinux.h" | 18 #include "ui/base/ime/input_method_auralinux.h" |
20 #elif defined(OS_ANDROID) | 19 #elif defined(OS_ANDROID) |
21 #include "ui/base/ime/input_method_android.h" | 20 #include "ui/base/ime/input_method_android.h" |
22 #else | 21 #else |
23 #include "ui/base/ime/input_method_minimal.h" | 22 #include "ui/base/ime/input_method_minimal.h" |
24 #endif | 23 #endif |
(...skipping 21 matching lines...) Expand all Loading... |
46 g_input_method_for_testing = nullptr; | 45 g_input_method_for_testing = nullptr; |
47 return make_scoped_ptr(ret); | 46 return make_scoped_ptr(ret); |
48 } | 47 } |
49 | 48 |
50 if (g_input_method_set_for_testing) | 49 if (g_input_method_set_for_testing) |
51 return make_scoped_ptr(new MockInputMethod(delegate)); | 50 return make_scoped_ptr(new MockInputMethod(delegate)); |
52 | 51 |
53 #if defined(OS_CHROMEOS) | 52 #if defined(OS_CHROMEOS) |
54 return make_scoped_ptr(new InputMethodChromeOS(delegate)); | 53 return make_scoped_ptr(new InputMethodChromeOS(delegate)); |
55 #elif defined(OS_WIN) | 54 #elif defined(OS_WIN) |
56 if (IsRemoteInputMethodWinRequired(widget)) | |
57 return CreateRemoteInputMethodWin(delegate); | |
58 return make_scoped_ptr(new InputMethodWin(delegate, widget)); | 55 return make_scoped_ptr(new InputMethodWin(delegate, widget)); |
59 #elif defined(OS_MACOSX) | 56 #elif defined(OS_MACOSX) |
60 return make_scoped_ptr(new InputMethodMac(delegate)); | 57 return make_scoped_ptr(new InputMethodMac(delegate)); |
61 #elif defined(USE_AURA) && defined(OS_LINUX) && defined(USE_X11) && \ | 58 #elif defined(USE_AURA) && defined(OS_LINUX) && defined(USE_X11) && \ |
62 !defined(OS_CHROMEOS) | 59 !defined(OS_CHROMEOS) |
63 return make_scoped_ptr(new InputMethodAuraLinux(delegate)); | 60 return make_scoped_ptr(new InputMethodAuraLinux(delegate)); |
64 #elif defined(OS_ANDROID) | 61 #elif defined(OS_ANDROID) |
65 return make_scoped_ptr(new InputMethodAndroid(delegate)); | 62 return make_scoped_ptr(new InputMethodAndroid(delegate)); |
66 #else | 63 #else |
67 return make_scoped_ptr(new InputMethodMinimal(delegate)); | 64 return make_scoped_ptr(new InputMethodMinimal(delegate)); |
(...skipping 10 matching lines...) Expand all Loading... |
78 << "ui::SetUpInputMethodFactoryForTesting earlier."; | 75 << "ui::SetUpInputMethodFactoryForTesting earlier."; |
79 | 76 |
80 g_input_method_set_for_testing = true; | 77 g_input_method_set_for_testing = true; |
81 } | 78 } |
82 | 79 |
83 void SetUpInputMethodForTesting(InputMethod* input_method) { | 80 void SetUpInputMethodForTesting(InputMethod* input_method) { |
84 g_input_method_for_testing = input_method; | 81 g_input_method_for_testing = input_method; |
85 } | 82 } |
86 | 83 |
87 } // namespace ui | 84 } // namespace ui |
OLD | NEW |