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 "base/memory/singleton.h" | 7 #include "base/memory/singleton.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 #include "ui/base/ime/remote_input_method_win.h" |
17 #elif defined(USE_AURA) && defined(USE_X11) | 17 #elif defined(USE_AURA) && defined(USE_X11) |
18 #include "ui/base/ime/input_method_linux_x11.h" | 18 #include "ui/base/ime/input_method_auralinux.h" |
19 #else | 19 #else |
20 #include "ui/base/ime/input_method_minimal.h" | 20 #include "ui/base/ime/input_method_minimal.h" |
21 #endif | 21 #endif |
22 | 22 |
23 namespace { | 23 namespace { |
24 | 24 |
25 ui::InputMethodFactory* g_input_method_factory = NULL; | 25 ui::InputMethodFactory* g_input_method_factory = NULL; |
26 | 26 |
27 #if defined(OS_WIN) | 27 #if defined(OS_WIN) |
28 ui::InputMethod* g_shared_input_method = NULL; | 28 ui::InputMethod* g_shared_input_method = NULL; |
(...skipping 30 matching lines...) Expand all Loading... |
59 gfx::AcceleratedWidget widget) { | 59 gfx::AcceleratedWidget widget) { |
60 #if defined(OS_CHROMEOS) && defined(USE_X11) | 60 #if defined(OS_CHROMEOS) && defined(USE_X11) |
61 return scoped_ptr<InputMethod>(new InputMethodIBus(delegate)); | 61 return scoped_ptr<InputMethod>(new InputMethodIBus(delegate)); |
62 #elif defined(OS_WIN) | 62 #elif defined(OS_WIN) |
63 if (base::win::IsTSFAwareRequired()) | 63 if (base::win::IsTSFAwareRequired()) |
64 return scoped_ptr<InputMethod>(new InputMethodTSF(delegate, widget)); | 64 return scoped_ptr<InputMethod>(new InputMethodTSF(delegate, widget)); |
65 if (IsRemoteInputMethodWinRequired(widget)) | 65 if (IsRemoteInputMethodWinRequired(widget)) |
66 return CreateRemoteInputMethodWin(delegate); | 66 return CreateRemoteInputMethodWin(delegate); |
67 return scoped_ptr<InputMethod>(new InputMethodIMM32(delegate, widget)); | 67 return scoped_ptr<InputMethod>(new InputMethodIMM32(delegate, widget)); |
68 #elif defined(USE_AURA) && defined(USE_X11) | 68 #elif defined(USE_AURA) && defined(USE_X11) |
69 return scoped_ptr<InputMethod>(new InputMethodLinuxX11(delegate)); | 69 return scoped_ptr<InputMethod>(new InputMethodAuraLinux(delegate)); |
70 #else | 70 #else |
71 return scoped_ptr<InputMethod>(new InputMethodMinimal(delegate)); | 71 return scoped_ptr<InputMethod>(new InputMethodMinimal(delegate)); |
72 #endif | 72 #endif |
73 } | 73 } |
74 | 74 |
75 // MockInputMethodFactory | 75 // MockInputMethodFactory |
76 | 76 |
77 // static | 77 // static |
78 MockInputMethodFactory* MockInputMethodFactory::GetInstance() { | 78 MockInputMethodFactory* MockInputMethodFactory::GetInstance() { |
79 return Singleton<MockInputMethodFactory>::get(); | 79 return Singleton<MockInputMethodFactory>::get(); |
(...skipping 28 matching lines...) Expand all Loading... |
108 | 108 |
109 void DestroySharedInputMethod() { | 109 void DestroySharedInputMethod() { |
110 delete g_shared_input_method; | 110 delete g_shared_input_method; |
111 g_shared_input_method = NULL; | 111 g_shared_input_method = NULL; |
112 } | 112 } |
113 | 113 |
114 } // namespace internal | 114 } // namespace internal |
115 #endif | 115 #endif |
116 | 116 |
117 } // namespace ui | 117 } // namespace ui |
OLD | NEW |