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 "ui/base/ime/input_method_delegate.h" | 7 #include "ui/base/ime/input_method_delegate.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) && defined(USE_X11) | 10 #if defined(OS_CHROMEOS) && defined(USE_X11) |
11 #include "ui/base/ime/input_method_ibus.h" | 11 #include "ui/base/ime/input_method_ibus.h" |
12 #elif defined(OS_WIN) | 12 #elif defined(OS_WIN) |
13 #include "base/win/metro.h" | 13 #include "base/win/metro.h" |
14 #include "ui/base/ime/input_method_imm32.h" | 14 #include "ui/base/ime/input_method_imm32.h" |
15 #include "ui/base/ime/input_method_tsf.h" | 15 #include "ui/base/ime/input_method_tsf.h" |
| 16 #include "ui/base/ime/remote_input_method_win.h" |
16 #elif defined(USE_AURA) && defined(USE_X11) | 17 #elif defined(USE_AURA) && defined(USE_X11) |
17 #include "ui/base/ime/input_method_linux_x11.h" | 18 #include "ui/base/ime/input_method_linux_x11.h" |
18 #else | 19 #else |
19 #include "ui/base/ime/fake_input_method.h" | 20 #include "ui/base/ime/fake_input_method.h" |
20 #endif | 21 #endif |
21 | 22 |
22 namespace ui { | 23 namespace ui { |
23 namespace { | 24 namespace { |
24 | 25 |
25 bool g_input_method_set_for_testing = false; | 26 bool g_input_method_set_for_testing = false; |
26 InputMethod* g_shared_input_method = NULL; | 27 InputMethod* g_shared_input_method = NULL; |
27 | 28 |
28 #if defined(OS_WIN) | 29 #if defined(OS_WIN) |
29 // Returns a new instance of input method object for IMM32 or TSF. | 30 // Returns a new instance of input method object for Windows. |
30 scoped_ptr<InputMethod> CreateInputMethodWinInternal( | 31 scoped_ptr<InputMethod> CreateInputMethodWinInternal( |
31 internal::InputMethodDelegate* delegate, | 32 internal::InputMethodDelegate* delegate, |
32 gfx::AcceleratedWidget widget) { | 33 gfx::AcceleratedWidget widget) { |
33 if (base::win::IsTSFAwareRequired()) | 34 if (base::win::IsTSFAwareRequired()) |
34 return scoped_ptr<InputMethod>(new InputMethodTSF(delegate, widget)); | 35 return scoped_ptr<InputMethod>(new InputMethodTSF(delegate, widget)); |
35 else | 36 if (IsRemoteInputMethodWinRequired(widget)) |
36 return scoped_ptr<InputMethod>(new InputMethodIMM32(delegate, widget)); | 37 return CreateRemoteInputMethodWin(delegate); |
| 38 return scoped_ptr<InputMethod>(new InputMethodIMM32(delegate, widget)); |
37 } | 39 } |
38 #endif | 40 #endif |
39 | 41 |
40 } // namespace | 42 } // namespace |
41 | 43 |
42 scoped_ptr<InputMethod> CreateInputMethod( | 44 scoped_ptr<InputMethod> CreateInputMethod( |
43 internal::InputMethodDelegate* delegate, | 45 internal::InputMethodDelegate* delegate, |
44 gfx::AcceleratedWidget widget) { | 46 gfx::AcceleratedWidget widget) { |
45 if (g_input_method_set_for_testing) | 47 if (g_input_method_set_for_testing) |
46 return scoped_ptr<InputMethod>(new MockInputMethod(delegate)); | 48 return scoped_ptr<InputMethod>(new MockInputMethod(delegate)); |
(...skipping 24 matching lines...) Expand all Loading... |
71 | 73 |
72 namespace internal { | 74 namespace internal { |
73 | 75 |
74 void DestroySharedInputMethod() { | 76 void DestroySharedInputMethod() { |
75 delete g_shared_input_method; | 77 delete g_shared_input_method; |
76 g_shared_input_method = NULL; | 78 g_shared_input_method = NULL; |
77 } | 79 } |
78 | 80 |
79 } // namespace internal | 81 } // namespace internal |
80 } // namespace ui | 82 } // namespace ui |
OLD | NEW |